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

Regression in paths without hosts in v2.1.1 vs v2.1.0 #581

Closed
russelltg opened this issue Jan 19, 2020 · 2 comments
Closed

Regression in paths without hosts in v2.1.1 vs v2.1.0 #581

russelltg opened this issue Jan 19, 2020 · 2 comments

Comments

@russelltg
Copy link

The code

println!("{:?}", url::Url::parse("udp://:2223"));

Prints Ok("udp://:2223/") in v2.1.0, but now prints Err(EmptyHost) in v2.1.1. Is this an intended change? Is there any way I can get it to parse these hostless urls?

@bstrie
Copy link

bstrie commented Feb 6, 2020

I'm no expert, but I believe this is the intended behavior of adhering to the URL specification. I think the relevant section is https://url.spec.whatwg.org/#hostname-state , and if I'm correct this URL is hitting the following condition:

  • Otherwise, if c is U+003A (:) and the [] flag is unset, then:
    • If buffer is the empty string, validation error, return failure.

@djc
Copy link
Contributor

djc commented Aug 25, 2020

Yeah, I guess this is intended behavior. It also seems fairly reasonable, so I'll close this issue. Feel free to reopen if you disagree and have a better plan of action!

@djc djc closed this as completed Aug 25, 2020
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

No branches or pull requests

3 participants