Merge branch v2.10 into v3.0
This commit is contained in:
commit
a7ef965412
36 changed files with 751 additions and 107 deletions
|
@ -31,10 +31,19 @@ func newResponseModifier(w http.ResponseWriter, r *http.Request, modifier func(*
|
|||
}
|
||||
}
|
||||
|
||||
// WriteHeader is, in the specific case of 1xx status codes, a direct call to the wrapped ResponseWriter, without marking headers as sent,
|
||||
// allowing so further calls.
|
||||
func (r *responseModifier) WriteHeader(code int) {
|
||||
if r.headersSent {
|
||||
return
|
||||
}
|
||||
|
||||
// Handling informational headers.
|
||||
if code >= 100 && code <= 199 {
|
||||
r.rw.WriteHeader(code)
|
||||
return
|
||||
}
|
||||
|
||||
defer func() {
|
||||
r.code = code
|
||||
r.headersSent = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue