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

fix($location): rewrite relative paths correctly path==='/' in legacy html5Mode #8684

Closed
wants to merge 1 commit into from

Conversation

caitp
Copy link
Contributor

@caitp caitp commented Aug 20, 2014

Currently, legacy browsers get to use a clever scheme for resolving relative
URIs in html5Mode, and resolve the URI relative to $location.path().

Currently, $location.path() can be '/' under certain circumstances, which
means that when we split $location.path() on '/' and later join by '/' after
adding another path component, we end up with '//pathComponent'. $$rewrite
fails to deal with this correctly, and effectively the $location is never
changed from the root path.

This CL corrects this by ensuring that the duplicate '/' situation does not
occur when resolving relative URIs.

… html5Mode

Currently, legacy browsers get to use a clever scheme for resolving relative URIs in html5Mode,
and resolve the URI relative to $location.path().

Currently, $location.path() can be '/' under certain circumstances, which means that when we
split $location.path() on '/' and later join by '/' after adding another path component,
we end up with '//pathComponent'. $$rewrite fails to deal with this correctly, and effectively
the $location is never changed from the root path.

This CL corrects this by ensuring that the duplicate '/' situation does not occur when resolving
relative URIs.
@caitp
Copy link
Contributor Author

caitp commented Aug 20, 2014

I'm just trying to get a jsfiddle to work correctly with #8233 landed, and there are a lot of subtle bugs which prevent the bug from actually being fixed (such as this one)... Getting ready to land #8233 btu it's currently blocked on these small things.

If tests are green I plan to land this one tonight, TBR=angular-core.

caitp added a commit that referenced this pull request Aug 20, 2014
…y html5Mode

Currently, legacy browsers get to use a clever scheme for resolving relative URIs in html5Mode,
and resolve the URI relative to $location.path().

Currently, $location.path() can be '/' under certain circumstances, which means that when we
split $location.path() on '/' and later join by '/' after adding another path component,
we end up with '//pathComponent'. $$rewrite fails to deal with this correctly, and effectively
the $location is never changed from the root path.

This CL corrects this by ensuring that the duplicate '/' situation does not occur when resolving
relative URIs.

Closes #8684
@caitp caitp closed this in d18b281 Aug 20, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant