Repository navigation
fix(device-client): never use a proxy from the environment - #137
Merged
Merged
Conversation
…ironment reqwest reads HTTP_PROXY, HTTPS_PROXY and ALL_PROXY by default and does not exempt loopback, so a request carrying the bearer token went to the proxy a machine named, even for 127.0.0.1. The client now sets no_proxy. A test runs the test binary as a child with the proxy variables set and checks that the proxy gets no connection.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HTTP_PROXY(orALL_PROXY,HTTPS_PROXY) set, a request throughHttpApito a loopback engine went to the proxy, bearer token included (the child got the proxy's 502). reqwest reads those variables by default and does not exempt loopback.HttpApinow builds its client with.no_proxy(). Redirects were already off.tests/no_proxy.rs: runs the test binary again as a child with the proxy variables set (and aNO_PROXYthat does not name the engine) to a second listener; the proxy must get no connection and the engine must get the request. Without.no_proxy()the test fails.Testing
.no_proxy()makesa_proxy_in_the_environment_never_sees_a_request_to_the_enginefail.Co-authors
none
AI usage
Checklist
docs/architecture.mdwith any rule change; generated wire types with any contract change