Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

colon in filename oddity? #43

Closed
bmeck opened this issue Aug 14, 2017 · 11 comments
Closed

colon in filename oddity? #43

bmeck opened this issue Aug 14, 2017 · 11 comments

Comments

@bmeck
Copy link

bmeck commented Aug 14, 2017

colons appear to make files never able to be found?

// a.mjs
import './colons%3Awork'
import './colons:work'
// colons:work.js
// this space left blank
@bmeck
Copy link
Author

bmeck commented Aug 14, 2017

might look into using require('url').URL if possible.

@jdalton
Copy link
Member

jdalton commented Aug 14, 2017

What is the expected behavior for both './colons&3awork' and './colons:work'

@bmeck
Copy link
Author

bmeck commented Aug 14, 2017

in URL resolution they are just colons since ./ kicks it to pathname bit.

@bmeck
Copy link
Author

bmeck commented Aug 14, 2017

oh. yes, both should work. forgot to actually state that.

@jdalton
Copy link
Member

jdalton commented Aug 14, 2017

Would it be possible for you to show a vanilla WHATWG URL usage that produces a decoded file:// protocol path containing a ":".

@bmeck
Copy link
Author

bmeck commented Aug 14, 2017

new URL('file://localhost/test:123')
new URL('./test:123', 'file:///')

@jdalton
Copy link
Member

jdalton commented Aug 14, 2017

and the &3a encoded one...

@bmeck
Copy link
Author

bmeck commented Aug 14, 2017

sleepy typo, should use %

new URL('file://localhost/test%3A123')
new URL('./%3A', 'file:///')

When canonicalized in https://github.com/nodejs/node/blob/master/lib/internal/url.js#L1370 it becomes :

@jdalton
Copy link
Member

jdalton commented Aug 14, 2017

Ah 👌,

I was super confused, thinking maybe there was another form of escapes besides percent 😋

What form of decode do you do? I noticed that decodeURI doesn't decode %3a.
Is it more the old school unescape() or decodeURIComponent()?

@bmeck
Copy link
Author

bmeck commented Aug 14, 2017

That function does things in very specific ordering, but uses decodeURIComponent for the split up chunks it makes.

@jdalton
Copy link
Member

jdalton commented Aug 15, 2017

Closed by 3b0244a.
I'll be adding a round of unit tests over the next couple of days to solidify support.

@jdalton jdalton closed this as completed Aug 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants