Skip to content

Commit

Permalink
Merge pull request #117 from baker-yuan/patch-2
Browse files Browse the repository at this point in the history
fix:http header 设置失败修复
  • Loading branch information
Dot-Liu authored Jun 23, 2023
2 parents 71d19a5 + b436cea commit af6c54a
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 af6c54a

Please sign in to comment.