-
Notifications
You must be signed in to change notification settings - Fork 760
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid duplicating authorization header with netrc (#2325)
## Summary The netrc middleware we added in #2241 has a slight problem. If you include credentials in your index URL, _and_ in the netrc file, the crate blindly adds the netrc credentials as a header. And given the `ReqwestBuilder` API, this means you end up with _two_ `Authorization` headers, which always leads to an invalid request, though the exact failure can take different forms. This PR removes the middleware crate in favor of our own middleware. Instead of using the `RequestInitialiser` API, we have to use the `Middleware` API, so that we can remove the header on the request itself. Closes #2323. ## Test Plan - Verified that running against a private index with credentials in the URL (but no netrc file) worked without error. - Verified that running against a private index with credentials in the netrc file (but not the URL) worked without error. - Verified that running against a private index with a mix of credentials in both _also_ worked without error.
- Loading branch information
1 parent
7fc8087
commit 67fb023
Showing
5 changed files
with
83 additions
and
16 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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