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
# Proxy server returns 407 to unauthenticated requestsexport https_proxy=http://proxy.example.com:3128
go run main.go
What did you expect to see?
I would like to make a contribution to update the error returned on non 200 response on CONNECT request from https proxy to be a new error type such that I can interrogate the response from the proxy, instead of having to handle the error based on the text of the error message.
So I'm able to do something like:
I'm happy to raise a PR if this is something that would be accepted
What did you see instead?
Proxy Authentication Required
Response is nil
The text was updated successfully, but these errors were encountered:
seankhliao
changed the title
http.DefaultTransport doesn't expose CONNECT request to caller on https proxy error
proposal: net/http: return error for proxy CONNECT errors
Feb 5, 2021
I was going to make an alternative suggestion in this issue that RoundTrip return the error and the response;
seeing as it would be returning an error for a request you didn't explicitly make (i.e the CONNECT request)
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?(actually using golang:latest eba5d0436b0b from dockerhub to compile)
go env
OutputWhat did you do?
main.go
What did you expect to see?
I would like to make a contribution to update the error returned on non 200 response on CONNECT request from https proxy to be a new error type such that I can interrogate the response from the proxy, instead of having to handle the error based on the text of the error message.
So I'm able to do something like:
Currently a basic error type is returned:
go/src/net/http/transport.go
Line 1719 in 8869086
I'm happy to raise a PR if this is something that would be accepted
What did you see instead?
Proxy Authentication Required
Response is nil
The text was updated successfully, but these errors were encountered: