Skip to content

Commit 1f82f02

Browse files
mrogala-saucemarkamsauce
authored andcommitted
fix code formating
1 parent ff463c3 commit 1f82f02

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

internal/martian/proxy_conn.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,14 @@ func (p *proxyConn) handleMITM(req *http.Request) error {
189189
if isClosedConnError(err) {
190190
log.Debug(ctx, "mitm: incoming connection closed prematurely during TLS handshake", "error", err)
191191
} else {
192+
remoteAddr := p.conn.RemoteAddr().String()
193+
host, _, splitErr := net.SplitHostPort(remoteAddr)
192194

193-
remote_addr := p.conn.RemoteAddr().String()
194-
host, _, split_err := net.SplitHostPort(remote_addr)
195-
196-
if split_err == nil {
197-
remote_addr = host
195+
if splitErr == nil {
196+
remoteAddr = host
198197
}
199198

200-
log.Error(ctx, "mitm: failed to handshake incoming TLS connection", "host", req.Host, "client", remote_addr, "error", err)
199+
log.Error(ctx, "mitm: failed to handshake incoming TLS connection", "host", req.Host, "client", remoteAddr, "error", err)
201200
}
202201
return errClose
203202
}

0 commit comments

Comments
 (0)