Merge current v2.9 into v3.0

This commit is contained in:
Tom Moulard 2023-01-09 16:21:45 +01:00
commit cd90b9761a
No known key found for this signature in database
GPG key ID: 521ABE0C1A0DEAF6
8 changed files with 74 additions and 13 deletions

View file

@ -209,6 +209,15 @@ func (cc *codeCatcher) Flush() {
// Otherwise, cc.code is actually a 200 here.
cc.WriteHeader(cc.code)
// We don't care about the contents of the response,
// since we want to serve the ones from the error page,
// so we just don't flush.
// (e.g., To prevent superfluous WriteHeader on request with a
// `Transfert-Encoding: chunked` header).
if cc.caughtFilteredCode {
return
}
if flusher, ok := cc.responseWriter.(http.Flusher); ok {
flusher.Flush()
}