Repository navigation
test(device-client): prove the real transport never follows a redirect - #136
Merged
Merged
Conversation
A loopback server answers 301, 302, 303, 307 and 308 with a Location to a second listener. Every method with a bearer token comes back as the redirect answer and the second listener never gets a connection. Plain http is also refused for any host that is not a loopback IP literal.
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
HttpApinever follows a redirect: a loopback server answers 301, 302, 303, 307 and 308 with aLocationto a second loopback listener; GET, POST, PUT and DELETE with a bearer token each come back as the redirect answer, and the second listener sees no connection (the older test redirected to a closed port, which proved nothing).httpis refused for any host that is not a loopback IP literal (example.com,localhost,10.0.0.1, a private port,[2001:db8::1],127.0.0.1.example.com); loopback http and https are allowed.Testing
redirect::Policy::default()makes the test fail.Co-authors
none
AI usage
Checklist
docs/architecture.mdwith any rule change; generated wire types with any contract change