-
Notifications
You must be signed in to change notification settings - Fork 27.4k
fix($location): add semicolon to whitelist of delimiters to unencode #8377
Conversation
Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.
If you need to make changes to your pull request, you can update the commit with Thanks again for your help! |
}); | ||
|
||
inject(function($location, $browser, $rootScope) { | ||
$rootScope.$digest(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect(fn).not.toThrow() maybe? (so that what is being asserted is more clear)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call
Also should close #6140 |
Also close #4067 |
Actually should not close #6140 since that issue is recommending an API change to make query param delimiter configurable. |
return b; | ||
}; | ||
}); | ||
var self = this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so I'm not sure what we're using self
for here, I'd remove that --- but with tests passing it looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 - I suspect this line is left over from something else
LGTM |
Some servers require characters within path segments to contain semicolons, such as `/;jsessionid=foo` in order to work correctly. RFC-3986 includes semicolons as acceptable sub-delimiters inside of path and query, but $location currently encodes semicolons. This can cause an infinite digest to occur since $location is comparing the internal semicolon-encoded url with the semicolon-unencoded url returned from window.location.href, causing Angular to believe the url is changing with each digest loop. This fix adds ";" to the list of characters to unencode after encoding queries or path segments. Closes angular#5019
Landed 3625803 |
So running into the opposite issue of this, from the $http module, and I'm wondering if the issue you were having @jeffbcross was specific to the $location module. Currently looking into making the semicolon encoding toggle-able, or some kind of global flag. |
Some servers require characters within path segments to contain semicolons,
such as
/;jsessionid=foo
in order to work correctly. RFC-3986 includessemicolons as acceptable sub-delimiters inside of path and query, but $location
currently encodes semicolons. This can cause an infinite digest to occur since $location
is comparing the internal semicolon-encoded url with the semicolon-unencoded url returned
from window.location.href, causing Angular to believe the url is changing with each digest
loop.
This fix adds ";" to the list of characters to unencode after encoding queries or path segments.
Closes #5019