Skip to content

Commit 747544b

Browse files
committed
Use status code constant
1 parent b6a0d77 commit 747544b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ func (d *Dialer) DialContext(ctx context.Context, urlStr string, requestHeader h
399399
}
400400
}
401401

402-
if resp.StatusCode != 101 ||
402+
if resp.StatusCode != http.StatusSwitchingProtocols ||
403403
!tokenListContainsValue(resp.Header, "Upgrade", "websocket") ||
404404
!tokenListContainsValue(resp.Header, "Connection", "upgrade") ||
405405
resp.Header.Get("Sec-Websocket-Accept") != computeAcceptKey(challengeKey) {

proxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func (hpd *httpProxyDialer) Dial(network string, addr string) (net.Conn, error)
7575
return nil, err
7676
}
7777

78-
if resp.StatusCode != 200 {
78+
if resp.StatusCode != http.StatusOK {
7979
if err := conn.Close(); err != nil {
8080
log.Printf("httpProxyDialer: failed to close connection: %v", err)
8181
}

0 commit comments

Comments
 (0)