mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
Allow duplicate Server headers when proxying response
See discussion on commit c9b022b5e0
If we overwrite the Server header, it becomes difficult/impossible to
know from the client whether the request was proxied through Caddy.
This commit is contained in:
parent
7b5efb5d75
commit
43b56d621b
1 changed files with 6 additions and 2 deletions
|
@ -413,9 +413,13 @@ func copyHeader(dst, src http.Header) {
|
|||
if _, shouldSkip := skipHeaders[k]; shouldSkip {
|
||||
continue
|
||||
}
|
||||
// otherwise, overwrite
|
||||
// otherwise, overwrite to avoid duplicated fields that can be
|
||||
// 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 {
|
||||
dst.Add(k, v)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue