fix(http): encode correct value for %3D (#9790)

This commit is contained in:
Florian Knop 2016-08-27 00:47:29 +02:00 committed by Victor Berchet
parent 6c77d7182a
commit 75553200c0
2 changed files with 3 additions and 3 deletions

View File

@ -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, '/');
}

View File

@ -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, ''));