Skip to content

Commit

Permalink
fix(http1): use bytes.EqualFold for header value check (#1232)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaost authored Nov 19, 2024
1 parent 3697f89 commit 74815dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/protocol/http1/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ func (c *HostClient) doNonNilReqResp(req *protocol.Request, resp *protocol.Respo
shouldCloseConn = resetConnection || req.ConnectionClose() || resp.ConnectionClose()

if resp.Header.StatusCode() == consts.StatusSwitchingProtocols &&
bytes.Equal(resp.Header.Peek(consts.HeaderConnection), bytestr.StrUpgrade) {
bytes.EqualFold(resp.Header.Peek(consts.HeaderConnection), bytestr.StrUpgrade) {
// can not reuse connection in this case, it's no longer http1 protocol.
// set BodyStream for (*Response).Hijack
resp.SetBodyStream(newUpgradeConn(c, cc), -1)
Expand Down

0 comments on commit 74815dd

Please sign in to comment.