Skip to content

Commit

Permalink
fix:http header 设置失败修复
Browse files Browse the repository at this point in the history
  • Loading branch information
baker-yuan authored and bakeryuan committed Jun 20, 2023
1 parent 71d19a5 commit b436cea
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions node/http-context/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit b436cea

Please sign in to comment.