Skip to content

Commit 362a52f

Browse files
committed
Fix nil pointer in HTTP proxy
1 parent c433f46 commit 362a52f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

http.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,10 @@ func (lo *localConn) handleHTTP() {
8383
if *verbose {
8484
logger.Printf("H %5d: * Local connection reset. Sent %d bytes.", lo.total, totalBytes)
8585
}
86-
if tcp, ok := (*re.conn).(*net.TCPConn); ok {
87-
tcp.SetLinger(0)
86+
if re.conn != nil {
87+
if tcp, ok := (*re.conn).(*net.TCPConn); ok {
88+
tcp.SetLinger(0)
89+
}
8890
}
8991
} else if strings.Contains(err.Error(), "malformed") {
9092
if *verbose {

0 commit comments

Comments
 (0)