-
Notifications
You must be signed in to change notification settings - Fork 268
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
Correct parsing of basic authentication to comply with RFC7617 #477
Conversation
Thanks, I'll have a look at this soon. |
The basic_auth tests doesn't seem to work
|
Shouldn't an empty password be supported?
Currently this is returned
|
My fault! The line Tests work now. |
the first colon, including any colons.
Got an out of band comment that I should add more tests. |
Yes, we generally want tests for any new functionality. |
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.
LGTM
Thanks for fixing this! |
According to RFC7617 the password consists of everything following the first colon, including any colons.
Using string:tokens/2 effectively removes any leading and or trailing colons, and compacts all multiple colons in the password into single ones:
Auth = "foo:::bar:::frob::::"
gives{"foo", "bar:frob"}
, which obviously is incorrect. The PR changes this to returning{"foo", "::bar:::frob::::"}
.