diff options
author | Alexander Graf <ghostwheel42@users.noreply.github.com> | 2022-10-29 22:35:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-29 16:35:44 -0400 |
commit | 087f126cf4c8750424b26f177aa7f426be806b7f (patch) | |
tree | a9bd16aa20568ef787d7f9887f2048597a0d88da /modules/caddyhttp | |
parent | 1fa4cb7ba15b2e3166a30258fd99e13eac5fdd0e (diff) |
caddyhttp: Canonicalize header field names (#5176)
Diffstat (limited to 'modules/caddyhttp')
-rw-r--r-- | modules/caddyhttp/staticresp.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/caddyhttp/staticresp.go b/modules/caddyhttp/staticresp.go index 411a7bc..add5b12 100644 --- a/modules/caddyhttp/staticresp.go +++ b/modules/caddyhttp/staticresp.go @@ -21,6 +21,7 @@ import ( "fmt" "io" "net/http" + "net/textproto" "os" "strconv" "strings" @@ -193,7 +194,7 @@ func (s StaticResponse) ServeHTTP(w http.ResponseWriter, r *http.Request, next H // set all headers for field, vals := range s.Headers { - field = repl.ReplaceAll(field, "") + field = textproto.CanonicalMIMEHeaderKey(repl.ReplaceAll(field, "")) newVals := make([]string, len(vals)) for i := range vals { newVals[i] = repl.ReplaceAll(vals[i], "") |