-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
🏭 Add BasicAuth addon #223
Conversation
I have a question here: I also use the |
If you intend to make this compatible with React Native, it doesn't support atob or btoa (yet) other than through polyfills. |
This should already work in any environment that has native |
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.
👏 👍 Excellent work, thanks a bunch for this PR! And really sorry for not reviewing earlier (I have been quite busy these last 2 months).
I just have a couple of comments regarding polyfills:
- polyfilling
URL
/TextEncoder
is not strictly necessary since the minimum level of support we are aiming for is node 14 which includes both out of the box - I'm fine with not polyfilling
btoa
/atob
, regarding react native it seems like they are already supporting it (or will be very soon): Add support foratob()
andbtoa()
functions facebook/hermes#1178
Just a small note: I use |
Oh sorry I did not get that 👍.
Yes I think using the global |
Implement BasicAuth addon that adds following behaviors: - allows setting credentials via the `.basicAuth()` method - parses URLs and extracts credentials from them, converting them to an Authorization header and removing them from the URL which would otherwise throw an error when passed to native fetch() - correctly parses usernames/passwords that contain non-latin characters (see https://developer.mozilla.org/en-US/docs/Glossary/Base64#the_unicode_problem)
Done |
Implement BasicAuth addon that adds following behaviors:
.basicAuth()
methodAuthorization
header and removing them from the URL which would otherwise throw an error when passed to nativefetch()
Fixes #221