Skip to content

Commit e82fe4a

Browse files
committed
net/http: close connection if OnProxyConnectResponse returns non-nil err
Signed-off-by: wm775825 <[email protected]>
1 parent 0324250 commit e82fe4a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/net/http/transport.go

+1
Original file line numberDiff line numberDiff line change
@@ -1761,6 +1761,7 @@ func (t *Transport) dialConn(ctx context.Context, cm connectMethod) (pconn *pers
17611761
if t.OnProxyConnectResponse != nil {
17621762
err = t.OnProxyConnectResponse(ctx, cm.proxyURL, connectReq, resp)
17631763
if err != nil {
1764+
conn.Close()
17641765
return nil, err
17651766
}
17661767
}

0 commit comments

Comments
 (0)