From b436cea429ac3f86865b7913cef8b826fd0f387c Mon Sep 17 00:00:00 2001 From: baker-yuan <40530122+baker-yuan@users.noreply.github.com> Date: Tue, 20 Jun 2023 20:48:10 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9Ahttp=20header=20=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- node/http-context/header.go | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/node/http-context/header.go b/node/http-context/header.go index e9b4233d..0d5b22fe 100644 --- a/node/http-context/header.go +++ b/node/http-context/header.go @@ -170,12 +170,9 @@ func (r *ResponseHeader) SetHeader(key, value string) { } func (r *ResponseHeader) AddHeader(key, value string) { - r.cache.Add(key, value) - - if r.afterProxy { - r.header.Add(key, value) - } else { + r.header.Add(key, value) + if !r.afterProxy { r.actions = append(r.actions, &headerAction{ Key: key, Value: value, @@ -185,12 +182,9 @@ func (r *ResponseHeader) AddHeader(key, value string) { } func (r *ResponseHeader) DelHeader(key string) { - r.cache.Del(key) - if r.afterProxy { - r.header.Del(key) - - } else { + r.header.Del(key) + if !r.afterProxy { r.actions = append(r.actions, &headerAction{ Key: key, Action: headerActionDel,