-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NO_PROXY port support + special case for proxying via localhost #11403
Conversation
@jimbishopp Can you please take a look too? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
api/client/proxy/proxy.go
Outdated
|
||
// parse parses a URL. If the address does not have a scheme, it will prepend "http" and try. | ||
func parse(addr string) (*url.URL, error) { | ||
proxyurl, err := url.Parse(addr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some things about this function are still unclear to me:
proxyurl
is still confusing because this function doesn't actually deal with proxy addresses now.- In which case
addr
will not have a scheme in it? - Shouldn't we default to
https
if the scheme is empty? That would be a more secure default, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whether or not addr
has a scheme depends on the caller; the existing proxy tests didn't have schemes, so I'm assuming that's a common and expected scenario.
The extra http://
is only there to help parse the url; parse
doesn't assume http. GetProxyAddress
handles the scheme-less URLs by checking https first, then http.
This change updates NO_PROXY handling to allow blocking specific host:port combinations, rather than just the host. It also adds a special case for downgrading requests to plain HTTP when --insecure is true and the request goes through a plain HTTP proxy at localhost (i.e. HTTP_PROXY=http://localhost).
This change updates NO_PROXY handling to allow blocking specific host:port combinations, rather than just the host. It also adds a special case for downgrading requests to plain HTTP when --insecure is true and the request goes through a plain HTTP proxy at localhost (i.e. HTTP_PROXY=http://localhost).
This PR updates NO_PROXY handling to allow blocking specific host:port combinations, rather than just the host. It also adds a special case for downgrading requests to plain HTTP when the following conditions are met:
--insecure
is trueHTTP_PROXY=http://localhost
)Resolves #10175.