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

file:// URIs not parsed correctly #158

Closed
ghost opened this issue Aug 1, 2014 · 3 comments
Closed

file:// URIs not parsed correctly #158

ghost opened this issue Aug 1, 2014 · 3 comments
Labels

Comments

@ghost
Copy link

ghost commented Aug 1, 2014

As per the RFC, this Wikipedia page and this StackOverflow entry file:// URIs can have a hostname in them. Currently URIjs completely ignores hosts in any file protocol URI.

eg.
URI('file://localhost/C:/somefile.txt').hostname() === ''
URI('http://localhost/C:/somefile.txt').hostname() === 'localhost'

The only case in which hostname should be empty is when supplied file:/// URIs in which case the host is literally empty.

@rodneyrehm
Copy link
Member

I can pinpoint this to URI.parse(). If you want to tackle this (and send a PR), please make sure you run / extend the tests accordingly.

I might get to this either early next week, or in 2 weeks time.

@ghost
Copy link
Author

ghost commented Aug 1, 2014

Thanks @rodneyrehm. There is no real "rush" to get this fixed, just thought I'd point it out. I'll see if I can get a PR together!

@rodneyrehm rodneyrehm added the Bug label Aug 20, 2014
rodneyrehm added a commit that referenced this issue Aug 20, 2014
@ghost
Copy link
Author

ghost commented Aug 22, 2014

👍

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

1 participant