Skip to content
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

enable proxy for remaining clients #152

Merged
merged 5 commits into from
Feb 21, 2024

Conversation

davidcollom
Copy link
Collaborator

On the back of #145 this add's support for the remaining Clients as there may be proxies across the entire environment

@davidcollom davidcollom merged commit 293835e into main Feb 21, 2024
5 checks passed
@davidcollom davidcollom deleted the enable-proxy-for-remaining-clients branch February 21, 2024 17:58
@aidy
Copy link
Contributor

aidy commented Feb 27, 2024

I don't think this was necessary.

It was required in #145, as you were providing a Transport object.
In these cases, Transport was nil, and so should default to DefaultTransport (https://cs.opensource.google/go/go/+/refs/tags/go1.22.0:src/net/http/client.go;l=60), which already has ProxyFromEnvironment set (https://github.com/golang/go/blob/master/src/net/http/transport.go#L44).

imo, it's better to leave it as nil so that you're sure to retain the other characteristics of DefaultTransport.

aidy added a commit to aidy/version-checker that referenced this pull request Mar 7, 2024
This reverts commit 293835e.

It's unnecessary to specify ProxyFromEnvironment in these cases.
It was required for the selfhosted client, as we are overriding the
default Transport object.

In these cases, Transport are nil, and so should default to
DefaultTransport: https://cs.opensource.google/go/go/+/refs/tags/go1.22.0:src/net/http/client.go;l=60

This already has ProxyFromEnvironment as the default behaviour:
https://github.com/golang/go/blob/master/src/net/http/transport.go#L44

As this is unnecessary, it's better to leave it undefined to ensure that
the other characteristics of DefaultTransport are retained.
aidy added a commit that referenced this pull request Mar 8, 2024
This reverts commit 293835e.

It's unnecessary to specify ProxyFromEnvironment in these cases.
It was required for the selfhosted client, as we are overriding the
default Transport object.

In these cases, Transport are nil, and so should default to
DefaultTransport: https://cs.opensource.google/go/go/+/refs/tags/go1.22.0:src/net/http/client.go;l=60

This already has ProxyFromEnvironment as the default behaviour:
https://github.com/golang/go/blob/master/src/net/http/transport.go#L44

As this is unnecessary, it's better to leave it undefined to ensure that
the other characteristics of DefaultTransport are retained.
davidcollom added a commit that referenced this pull request Mar 22, 2024
Co-authored-by: David Collom <david.collom@jetstack.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants