caddyhttp: responseRecorder save status in all cases (#5049)

This commit is contained in:
WeidiDeng authored and GitHub committed 2022-09-17 18:47:53 -06:00
1 parent 00beec2e34
commit c7a6bc5934
1 file changed
+3 -1
+3 -1
View File
@@ -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