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

Commit 0ea270e

Browse files
committedNov 19, 2013
fix(angular.encodeUriSegment): do not encode semi-colon
RFC 3986 indicates that ; is not encoded as part of the URI, as is the case with other members of sub-delim. Changed encodeUriSegment to match that behaviour, along with the corresponding spec.
1 parent 751f058 commit 0ea270e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed
 

‎src/Angular.js

+1
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,7 @@ function toKeyValue(obj) {
10651065
*/
10661066
function encodeUriSegment(val) {
10671067
return encodeUriQuery(val, true).
1068+
replace(/%3B/gi, ';').
10681069
replace(/%26/gi, '&').
10691070
replace(/%3D/gi, '=').
10701071
replace(/%2B/gi, '+');

‎test/AngularSpec.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -569,12 +569,12 @@ describe('angular', function() {
569569
toEqual("-_.!~*'()%20-_.!~*'()");
570570

571571
//don't encode the rest of pchar'
572-
expect(encodeUriSegment(':@&=+$, :@&=+$,')).
573-
toEqual(':@&=+$,%20:@&=+$,');
572+
expect(encodeUriSegment(':;@&=+$, :;@&=+$,')).
573+
toEqual(':;@&=+$,%20:;@&=+$,');
574574

575-
//encode '/', ';' and ' ''
576-
expect(encodeUriSegment('/; /;')).
577-
toEqual('%2F%3B%20%2F%3B');
575+
//encode '/', and ' ''
576+
expect(encodeUriSegment('/ /')).
577+
toEqual('%2F%20%2F');
578578
});
579579
});
580580

0 commit comments

Comments
 (0)
This repository has been archived.