mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-26 21:53:48 +03:00
caddyhttp: Canonicalize header field names (#5176)
This commit is contained in:
parent
1fa4cb7ba1
commit
087f126cf4
1 changed files with 2 additions and 1 deletions
|
@ -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], "")
|
||||
|
|
Loading…
Reference in a new issue