Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
dogancanbakir committed Mar 13, 2024
1 parent 70fb7e7 commit 1ba6d04
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,10 @@ func (p *Proxy) ModifyRequest(req *http.Request) error {
}

func (*Proxy) removeBrEncoding(req *http.Request) {
encodings := strings.Split(req.Header.Get("Accept-Encoding"), ",")
for i, encoding := range encodings {
encodings[i] = strings.TrimSpace(encoding)
}
encodings := strings.Split(strings.ReplaceAll(req.Header.Get("Accept-Encoding"), " ", ""), ",")
encodings = sliceutil.PruneEqual(encodings, "br")
req.Header.Set("Accept-Encoding", strings.Join(encodings, ", "))

}

// ModifyResponse
Expand Down

0 comments on commit 1ba6d04

Please sign in to comment.