You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When sending HTTPS requests with http-probe through a proxy, using proxy_url, user defined HTTP headers are not added to the CONNECT request.
This appears to be a limitation of https://pkg.go.dev/net/http where HTTP headers are only added to CONNECT requests if you specify them when creating the Transport object.
Fix
In http.go:L457 we could add any specified HTTP headers also to the CONNECT request like so:
for _, header := range p.c.GetHeaders() {
if header.GetName() == "Host" {
continue
}
t.ProxyConnectHeader = http.Header{header.GetName(): {header.GetValue()}}
}
It seems fairly simple to implement this but I'm not sure if adding user defined headers also to the CONNECT request has any other implications.
The text was updated successfully, but these errors were encountered:
Issue
When sending HTTPS requests with
http-probe
through a proxy, usingproxy_url
, user defined HTTP headers are not added to theCONNECT
request.This appears to be a limitation of https://pkg.go.dev/net/http where HTTP headers are only added to
CONNECT
requests if you specify them when creating theTransport
object.Fix
In
http.go:L457
we could add any specified HTTP headers also to theCONNECT
request like so:It seems fairly simple to implement this but I'm not sure if adding user defined headers also to the
CONNECT
request has any other implications.The text was updated successfully, but these errors were encountered: