Skip to content
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

username/password in URLs #335

Open
meejah opened this issue Dec 8, 2021 · 1 comment
Open

username/password in URLs #335

meejah opened this issue Dec 8, 2021 · 1 comment
Labels

Comments

@meejah
Copy link

meejah commented Dec 8, 2021

If a DecodedURL with a username/password in it is passed to a treq API, an error results about encoding a colon character (and the password is removed). (I can followup with the traceback but I don't have it immediately handy).

To make such a URL work, one can simply pass auth=url.userinfo to the treq reqeuest (and .replace(userinfo=()) to remove the username/password from URL) so it might be nice to have that as "a feature" in treq itself. That is, take out the userinfo from the DecodedURL and use it for authentication.

@meejah
Copy link
Author

meejah commented Dec 8, 2021

The error is something like this (note that the password after the colon is now gone). This is if you passed in something like DecodedURL.from_text(u"https://username:[email protected]")

    raise InvalidCodepoint('Codepoint {0} at position {1} of {2} not allowed'.format(_unot(cp_value), pos+1, repr(label)))
idna.core.InvalidCodepoint: Codepoint U+003A at position 9 of u'username:@example'' not allowed

@twm twm added the bug label Jan 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants