Skip to content

Commit

Permalink
fix statusCode store
Browse files Browse the repository at this point in the history
  • Loading branch information
miolini authored Mar 3, 2022
1 parent 09802d7 commit 4087551
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions response_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func (counter *ResponseWriterCounter) Header() http.Header {

// WriteHeader returns underlying WriteHeader, while setting Runtime header
func (counter *ResponseWriterCounter) WriteHeader(statusCode int) {
counter.statusCode = statusCode
counter.Header().Set("X-Runtime", fmt.Sprintf("%.6f", time.Since(counter.started).Seconds()))
counter.ResponseWriter.WriteHeader(statusCode)
}
Expand Down

0 comments on commit 4087551

Please sign in to comment.