Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

url: reslove urls with . and .. #9010

Closed
wants to merge 1 commit into from
Closed

Conversation

amir-s
Copy link

@amir-s amir-s commented Jan 11, 2015

. and .. are directory specs and resolving urls -with or without the hostname- with . and .. should add a trailing slash to the end of the url. (#8992)

The array srcPath contains url segments. If the path doesn't contain a hostname, the first element will be an empty string. In that case, if the last element is . or .., the final value must end with a trailing slash.

'.' and '..' are directory specs and resolving urls with or without
the hostname with '.' and '..' should add a trailing slash to the
end of the url.

Fix nodejs#8992
@trevnorris
Copy link

LGTM. I'll land it after the 0.10 to 0.12 merge.

@trevnorris trevnorris self-assigned this Jan 13, 2015
@trevnorris trevnorris added this to the 0.11.15 milestone Jan 13, 2015
@misterdjules
Copy link

That also affects v0.10:

➜  node git:(v0.10) ✗ ./node --version
v0.10.36-pre
➜  node git:(v0.10) ✗ ./node -p 'require("url").resolve("/foo/", ".");'        
/foo
➜  node git:(v0.10) ✗

Thus, I suggest landing this in v0.10 first. Removing from the 0.11.15 milestone as a consequence. I'm not sure when we want to land it in v0.10, so I'm not adding it to any v0.10 milestone for now, but feel free to do so.

@misterdjules misterdjules removed this from the 0.11.15 milestone Jan 15, 2015
@trevnorris
Copy link

@misterdjules Sounds like a good idea. Might as well land this on the v0.10 branch now. Can't think of a reason to hold it back. Though, does it apply cleanly?

@misterdjules
Copy link

@trevnorris It applies cleanly to v0.10.

@trevnorris
Copy link

@misterdjules Feel free to throw it on.

@amir-s
Copy link
Author

amir-s commented Feb 7, 2015

When this is going to be merged?

trevnorris pushed a commit that referenced this pull request Feb 9, 2015
'.' and '..' are directory specs and resolving urls with or without the
hostname with '.' and '..' should add a trailing slash to the end of the
url.

Fixes: #8992
PR-URL: #9010
Reviewed-by: Trevor Norris <[email protected]>
@trevnorris
Copy link

Thanks. Landed in ad06848.

@trevnorris trevnorris closed this Feb 9, 2015
misterdjules pushed a commit to misterdjules/node that referenced this pull request Mar 17, 2015
'.' and '..' are directory specs and resolving urls with or without the
hostname with '.' and '..' should add a trailing slash to the end of the
url.

Fixes: nodejs#8992
PR-URL: nodejs#9010
Reviewed-by: Trevor Norris <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants