summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/reverseproxy
diff options
context:
space:
mode:
authorMatt Holt <mholt@users.noreply.github.com>2022-09-29 08:19:56 -0600
committerGitHub <noreply@github.com>2022-09-29 08:19:56 -0600
commite2991eb019e36b612be3d7b43ed961c7a7e3841d (patch)
tree99caa545ba49f7076cda423b3bdc8d91ddb30910 /modules/caddyhttp/reverseproxy
parent897a38958cb733551339f40f04e5798fcda55bcc (diff)
reverseproxy: On 103 don't delete own headers (#5091)
See #5074
Diffstat (limited to 'modules/caddyhttp/reverseproxy')
-rw-r--r--modules/caddyhttp/reverseproxy/reverseproxy.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/caddyhttp/reverseproxy/reverseproxy.go b/modules/caddyhttp/reverseproxy/reverseproxy.go
index 4c8b29b..55d3aa8 100644
--- a/modules/caddyhttp/reverseproxy/reverseproxy.go
+++ b/modules/caddyhttp/reverseproxy/reverseproxy.go
@@ -782,8 +782,9 @@ func (h *Handler) reverseProxy(rw http.ResponseWriter, req *http.Request, origRe
copyHeader(h, http.Header(header))
rw.WriteHeader(code)
- // Clear headers, it's not automatically done by ResponseWriter.WriteHeader() for 1xx responses
- for k := range h {
+ // Clear headers coming from the backend
+ // (it's not automatically done by ResponseWriter.WriteHeader() for 1xx responses)
+ for k := range header {
delete(h, k)
}