From 75553200c00b7e4f32dc1c912a0b6b99c1eb5d3e Mon Sep 17 00:00:00 2001 From: Florian Knop Date: Sat, 27 Aug 2016 00:47:29 +0200 Subject: [PATCH] fix(http): encode correct value for %3D (#9790) --- modules/@angular/http/src/url_search_params.ts | 2 +- modules/@angular/http/test/url_search_params_spec.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/@angular/http/src/url_search_params.ts b/modules/@angular/http/src/url_search_params.ts index 5f6ff87085..6bda7d0800 100644 --- a/modules/@angular/http/src/url_search_params.ts +++ b/modules/@angular/http/src/url_search_params.ts @@ -41,7 +41,7 @@ function standardEncoding(v: string): string { .replace(/%2C/gi, ',') .replace(/%3B/gi, ';') .replace(/%2B/gi, '+') - .replace(/%3D/gi, ';') + .replace(/%3D/gi, '=') .replace(/%3F/gi, '?') .replace(/%2F/gi, '/'); } diff --git a/modules/@angular/http/test/url_search_params_spec.ts b/modules/@angular/http/test/url_search_params_spec.ts index 933318c151..237bee9a07 100644 --- a/modules/@angular/http/test/url_search_params_spec.ts +++ b/modules/@angular/http/test/url_search_params_spec.ts @@ -68,11 +68,11 @@ export function main() { **/ let params = new URLSearchParams(); - '! $ \' ( ) * + , ; A 9 - . _ ~ ? /'.split(' ').forEach( + '! $ \' ( ) * + , ; A 9 - . _ ~ ? / ='.split(' ').forEach( (char, idx) => { params.set(`a${idx}`, char); }); expect(params.toString()) .toBe( - `a0=!&a1=$&a2=\'&a3=(&a4=)&a5=*&a6=+&a7=,&a8=;&a9=A&a10=9&a11=-&a12=.&a13=_&a14=~&a15=?&a16=/` + `a0=!&a1=$&a2=\'&a3=(&a4=)&a5=*&a6=+&a7=,&a8=;&a9=A&a10=9&a11=-&a12=.&a13=_&a14=~&a15=?&a16=/&a17==` .replace(/\s/g, ''));