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

remove need for "//" after protocol? #182

Closed
stevenvachon opened this issue Dec 27, 2016 · 9 comments
Closed

remove need for "//" after protocol? #182

stevenvachon opened this issue Dec 27, 2016 · 9 comments

Comments

@stevenvachon
Copy link

If you remember this: http://bits.blogs.nytimes.com/2009/10/12/the-webs-inventor-regrets-one-small-thing/?_r=0

@annevk
Copy link
Member

annevk commented Dec 28, 2016

We cannot make backwards-incompatible changes.

@annevk annevk closed this as completed Dec 28, 2016
@stevenvachon
Copy link
Author

Would it still be backwards-incompatible if the "//" were optional instead of required?

@annevk
Copy link
Member

annevk commented Dec 28, 2016

The problem is that the parsing of such URLs depends on what the base URL is. Better to keep requiring it.

@stevenvachon
Copy link
Author

stevenvachon commented Dec 28, 2016

If the base URL has it, then the resolved URL can as well. It could optionally not do so too, I would think, but that may be something for a URL minifier/optimizer library.

@annevk
Copy link
Member

annevk commented Dec 28, 2016

I think you might have missed my point. I recommend looking at https://url.spec.whatwg.org/#example-url-parsing. Contrast examples 1, 4, and 5 in that table.

@stevenvachon
Copy link
Author

stevenvachon commented Dec 28, 2016

The 4th in that table might pose a problem.

There're other related examples not listed in that table:

Input Base Output
https:example https://example/
https:example https://example.com https://example/

@annevk
Copy link
Member

annevk commented Dec 28, 2016

The first is 1, no? The second looks bogus. Should be https://example.com/example.

@stevenvachon
Copy link
Author

stevenvachon commented Dec 28, 2016

The first one in your table has both a domain and top-level domain, which shouldn't make a difference.

Both whatwg-url and Node v7's url.URL must have the second one (in my example) wrong, then.

Input Base Output
https:example https://example/
https:example http://example.com https://example/

@stevenvachon
Copy link
Author

(updated above comment)

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

No branches or pull requests

2 participants