summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/headers
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2022-09-23 17:11:53 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2022-09-23 17:11:53 -0600
commit7041970059db9047143d82b2c489c7bc34df691f (patch)
tree9d2521ad5da212e7d50f2110b2eea1609f4dff24 /modules/caddyhttp/headers
parenteead00f54a4b5d55292b2dcf5f1ec462c79207ad (diff)
headers: Support repeated WriteHeader if 1xx (fix #5074)
Diffstat (limited to 'modules/caddyhttp/headers')
-rw-r--r--modules/caddyhttp/headers/headers.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/caddyhttp/headers/headers.go b/modules/caddyhttp/headers/headers.go
index d523723..f8d3fdc 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)