Commit 43b56d62 authored by Matthew Holt's avatar Matthew Holt

Allow duplicate Server headers when proxying response

See discussion on commit c9b022b5

If we overwrite the Server header, it becomes difficult/impossible to
know from the client whether the request was proxied through Caddy.
parent 7b5efb5d
...@@ -413,8 +413,12 @@ func copyHeader(dst, src http.Header) { ...@@ -413,8 +413,12 @@ func copyHeader(dst, src http.Header) {
if _, shouldSkip := skipHeaders[k]; shouldSkip { if _, shouldSkip := skipHeaders[k]; shouldSkip {
continue continue
} }
// otherwise, overwrite // otherwise, overwrite to avoid duplicated fields that can be
dst.Del(k) // problematic (see issue #1086) -- however, allow duplicate
// Server fields so we can see the reality of the proxying.
if k != "Server" {
dst.Del(k)
}
} }
for _, v := range vv { for _, v := range vv {
dst.Add(k, v) dst.Add(k, v)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment