Skip to content

Do not panic when parsing '.' in URL host: #166 #170

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

Closed
wants to merge 1 commit into from

Conversation

dlrobertson
Copy link

In response to #166. The parser should not panic when parsing URLs such as file://./foo.

Really this was just an excuse to dig into rust-url and learn more about it, so tips, comments, and critiques are welcomed!

Review on Reviewable

When parsing a url such as file://./foo the parser should not panic.
@dlrobertson
Copy link
Author


Review status: 0 of 2 files reviewed at latest revision, 1 unresolved discussion.


src/host.rs, line 62 [r1] (raw file):
Couldn't find much in the spec about this, so the same error from Url::from_directory_path is returned.


Comments from the review on Reviewable.io

@SimonSapin
Copy link
Member

Thanks for the PR! It turns out the underlying cause of the issue was a bit more subtle, so I’ll close this in favor of #171.

@SimonSapin SimonSapin closed this Feb 22, 2016
@SimonSapin
Copy link
Member

Specifically, a domain made of just a dot is turned into the empty string by IDNA code.

For the spec, see also whatwg/url#79

@dlrobertson
Copy link
Author

Thanks! Great comment on the spec too!

@dlrobertson dlrobertson deleted the i166 branch February 22, 2016 17:45
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 this pull request may close these issues.

2 participants