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

fix($location): don't crash if navigating outside the app base #12361

Closed
wants to merge 3 commits into from

Conversation

petebacondarwin
Copy link
Member

This should fix #11667

@@ -601,35 +601,35 @@ describe('$location', function() {


it('should return decoded characters for search specified in URL', function() {
var locationUrl = new LocationHtml5Url('http://host.com/');
var locationUrl = new LocationHtml5Url('http://host.com/', 'http://host.com/', 'http://host.com/');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the basePrefix really needed here ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. No that was a bit of over zealous cutting and pasting :-)

Previously, if you navigate outside of the Angular application, say be clicking
the back button, the $location service would try to handle the url change
and error due to the URL not being valid for the application.

This fixes that issue by ensuring that a reload happens when you navigate
to a URL that is not within the application.

Closes angular#11667
@Narretz
Copy link
Contributor

Narretz commented Jul 17, 2015

Is this resolved by 9e492c3 and 92c7ce5?

@petebacondarwin
Copy link
Member Author

Yes.

@petebacondarwin petebacondarwin deleted the issue-11667 branch November 24, 2016 09:06
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.

Back button broken in Chrome when setting location.href in HTML5 mode
3 participants