-
Notifications
You must be signed in to change notification settings - Fork 582
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
Request with basic auth does not work when passwords include umlaut #2133
Comments
You should really should study the cookbook:
|
i extended the testcase to also include explicitely created Mojo::URLs. But it also results in a 401
The request authorization header is the same for all four requests. |
If any of this is a bug depends entirely on the specs. Please provide references to specific spec sections we are currently violating. A random internet service is not a valid test case. |
According to RFC-7617 the encoding of the Authoritzation is undefined for backward-compatibility reasons and as long as it remains compatible with US-ASCII. The RFC suggests that it can be latin-1 or utf-8. Most server implementations and browsers nowadays seem to prefer the later. It is possible to include a charset parameter in the Authorization header, which only accepts utf8 as the only valid value. In this case
The Authoritzation header from my tests contains 'dGVzdGluZzp0ZXN09vb2bmc=' which is latin-1 and not utf-8 encoded. The webserver i was testing against is a nginx/1.18.0 with no special configuration
If you don't want to change Mojo useragent behaviour to use utf8 as default encoding, i suggest to honour the charset parameter in https://metacpan.org/pod/Mojo::UserAgent::Transactor#tx if it equals to utf-8 |
Steps to reproduce the behavior
Basic auth does not work when passwords include umlaut.
Same url works fine when requested via curl
Expected behavior
Request should succeed
Actual behavior
401 error
The text was updated successfully, but these errors were encountered: