mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-26 13:43:47 +03:00
caddyhttp: responseRecorder save status in all cases (#5049)
This commit is contained in:
parent
00beec2e34
commit
c7a6bc5934
1 changed files with 3 additions and 1 deletions
|
@ -170,9 +170,11 @@ func (rr *responseRecorder) WriteHeader(statusCode int) {
|
|||
return
|
||||
}
|
||||
|
||||
// save statusCode in case http middleware upgrading websocket
|
||||
// connections by manually setting headers and writing status 101
|
||||
rr.statusCode = statusCode
|
||||
// 1xx responses aren't final; just informational
|
||||
if statusCode < 100 || statusCode > 199 {
|
||||
rr.statusCode = statusCode
|
||||
rr.wroteHeader = true
|
||||
|
||||
// decide whether we should buffer the response
|
||||
|
|
Loading…
Reference in a new issue