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

URLs without // don't parse correctly #1529

Closed
sethmlarson opened this issue Jan 25, 2019 · 7 comments · Fixed by #1531
Closed

URLs without // don't parse correctly #1529

sethmlarson opened this issue Jan 25, 2019 · 7 comments · Fixed by #1531
Assignees

Comments

@sethmlarson
Copy link
Member

URLs like: mailto:johndoe@example.com don't parse correctly due to our logic on when to add a scheme delimeter to a URL.

@sethmlarson sethmlarson self-assigned this Jan 25, 2019
@shazow
Copy link
Member

shazow commented Jan 26, 2019

Hm, what should that parse to?

@sethmlarson
Copy link
Member Author

sethmlarson commented Jan 26, 2019

Per RFC3986 should be

Scheme: mailto
Userinfo: johndoe
Hostname: example.com

We have the same problem with javascript:

@sigmavirus24
Copy link
Contributor

@sethmlarson I think you may be confused.

: marks the end of the scheme, so you're correct that mailto is the scheme. // delinates the beginning of the authority, however, and the authority includes the userinfo and hostname and port. Effectively, without // the text following the : is actually part of the path if I remember correctly.

@sigmavirus24
Copy link
Contributor

rfc3986 has specific tests covering this, by the way, https://github.com/python-hyper/rfc3986/blob/0d82fee4b21482ae6cf4337dc8216e4d1ce507ea/tests/test_uri.py#L13

You can check everywhere that that particular fixture is used.

@sethmlarson
Copy link
Member Author

You're right @sigmavirus24, our scheme detecting regex is wrong but the above example shouldn't parse that way. Thanks for correcting me before I go too off the rails. :)

@sigmavirus24
Copy link
Contributor

It's unfortunate that I know the RFC as well as I do, but I guess also inevitable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants