Skip to content

Commit

Permalink
fix(http): encode correct value for %3D (#9790)
Browse files Browse the repository at this point in the history
  • Loading branch information
fknop authored and vicb committed Aug 26, 2016
1 parent 6c77d71 commit 7555320
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/@angular/http/src/url_search_params.ts
Expand Up @@ -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, '/');
}
Expand Down
4 changes: 2 additions & 2 deletions modules/@angular/http/test/url_search_params_spec.ts
Expand Up @@ -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, ''));


Expand Down

1 comment on commit 7555320

@maheee
Copy link

@maheee maheee commented on 7555320 Mar 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just stumbled upon this commit when doing Solr-Request which broke because of the unencoded equality sign inside a parameter value.
I'm pretty sure the equals sign has to be encoded when it's inside a query parameter key or value, so this doesn't make much sense.

Also, it doesn't fit the documentation which doesn't state that the equality sign isn't encoded.

Please sign in to comment.