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

Commit 7aac363

Browse files
committed
fixup! fix($location): fix infinite recursion/digest on URLs with special characters
1 parent c9adf16 commit 7aac363

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

test/ng/locationSpec.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,6 @@ describe('$location', function() {
10181018

10191019
$rootScope.$digest();
10201020

1021-
expect($browser.url()).toEqual('http://server/app/?q=%27');
10221021
expect($location.path()).toEqual('/');
10231022
expect($location.search()).toEqual({q: '\''});
10241023
expect($browserUrl).toHaveBeenCalledTimes(1);
@@ -1218,14 +1217,13 @@ describe('$location', function() {
12181217
it('should not infinite $digest on pushState() with quote in param', function() {
12191218
initService({html5Mode: true, supportHistory: true});
12201219
mockUpBrowser({initialUrl:'http://server/app/', baseHref:'/app/'});
1221-
inject(function($rootScope, $injector, $browser, $window) {
1220+
inject(function($rootScope, $injector, $window) {
12221221
var $location = $injector.get('$location');
12231222
$rootScope.$digest(); //allow $location initialization to finish
12241223

12251224
$window.history.pushState({}, null, 'http://server/app/Home?q=\'');
12261225
$rootScope.$digest();
12271226

1228-
expect($browser.url()).toEqual('http://server/app/Home?q=%27');
12291227
expect($location.absUrl()).toEqual('http://server/app/Home?q=\'');
12301228
expect($location.path()).toEqual('/Home');
12311229
expect($location.search()).toEqual({q: '\''});
@@ -1236,14 +1234,13 @@ describe('$location', function() {
12361234
it('should not infinite $digest on popstate event with quote in param', function() {
12371235
initService({html5Mode: true, supportHistory: true});
12381236
mockUpBrowser({initialUrl:'http://server/app/', baseHref:'/app/'});
1239-
inject(function($rootScope, $injector, $browser, $window) {
1237+
inject(function($rootScope, $injector, $window) {
12401238
var $location = $injector.get('$location');
12411239
$rootScope.$digest(); //allow $location initialization to finish
12421240

12431241
$window.location.href = 'http://server/app/Home?q=\'';
12441242
jqLite($window).triggerHandler('popstate');
12451243

1246-
expect($browser.url()).toEqual('http://server/app/Home?q=%27');
12471244
expect($location.absUrl()).toEqual('http://server/app/Home?q=\'');
12481245
expect($location.path()).toEqual('/Home');
12491246
expect($location.search()).toEqual({q: '\''});

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy