diff options
author | Matthew Holt <[email protected]> | 2022-09-23 17:11:53 -0600 |
---|---|---|
committer | Matthew Holt <[email protected]> | 2022-09-23 17:11:53 -0600 |
commit | 7041970059db9047143d82b2c489c7bc34df691f (patch) | |
tree | 9d2521ad5da212e7d50f2110b2eea1609f4dff24 | |
parent | eead00f54a4b5d55292b2dcf5f1ec462c79207ad (diff) | |
download | caddy-7041970059db9047143d82b2c489c7bc34df691f.tar.gz caddy-7041970059db9047143d82b2c489c7bc34df691f.zip |
headers: Support repeated WriteHeader if 1xx (fix #5074)
-rw-r--r-- | modules/caddyhttp/headers/headers.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/caddyhttp/headers/headers.go b/modules/caddyhttp/headers/headers.go index d52372369..f8d3fdcc3 100644 --- a/modules/caddyhttp/headers/headers.go +++ b/modules/caddyhttp/headers/headers.go @@ -332,7 +332,10 @@ func (rww *responseWriterWrapper) WriteHeader(status int) { if rww.wroteHeader { return } - rww.wroteHeader = true + // 1xx responses aren't final; just informational + if status < 100 || status > 199 { + rww.wroteHeader = true + } if rww.require == nil || rww.require.Match(status, rww.ResponseWriterWrapper.Header()) { if rww.headerOps != nil { rww.headerOps.ApplyTo(rww.ResponseWriterWrapper.Header(), rww.replacer) |