mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-23 12:31:07 +01:00
lib/proxy: log response body on non-200 response code
This should improve debuggability for https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1179
This commit is contained in:
parent
2256b79a89
commit
43f9842b6f
@ -159,7 +159,7 @@ func sendConnectRequest(proxyConn net.Conn, proxyAddr, dstAddr, authHeader strin
|
||||
return nil, fmt.Errorf("cannot read CONNECT response for dstAddr=%q: %w", dstAddr, err)
|
||||
}
|
||||
if statusCode := res.Header.StatusCode(); statusCode != 200 {
|
||||
return nil, fmt.Errorf("unexpected status code received: %d; want: 200", statusCode)
|
||||
return nil, fmt.Errorf("unexpected status code received: %d; want: 200; response body: %q", statusCode, res.Body())
|
||||
}
|
||||
return conn, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user