Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajax requests do not handle ampersand correctly #2389

Closed
ebeloded opened this issue Feb 19, 2017 · 3 comments
Closed

Ajax requests do not handle ampersand correctly #2389

ebeloded opened this issue Feb 19, 2017 · 3 comments

Comments

@ebeloded
Copy link

RxJS version: 5.1.0

Code to reproduce:
Rx.ajax.post('my-api',{ url: 'bla&foo=bar' })

Expected behavior:
Expected to send post request with a single parameter (url)

Actual behavior:
Sends post request with two parameters: url and foo

Additional information:
The problem could be resolved by setting Content-Type to application/json manually on each request, but presumably these requests should work out of the box.

@ericponto
Copy link

I think the body key/value pairs need to be encoded with encodeURIComponent instead of encodeURI. I can submit a PR for these changes.

ericponto pushed a commit to ericponto/rxjs that referenced this issue Feb 21, 2017
The contentType 'application/x-www-form-urlencoded' was using `encodeURI` but should be using
`encodeURIComponent` on the request body.

closes ReactiveX#2389
@zorji
Copy link

zorji commented Jun 21, 2017

I am having the same issue can we approve the pull request?

ericponto pushed a commit to ericponto/rxjs that referenced this issue Mar 30, 2018
The contentType 'application/x-www-form-urlencoded' was using encodeURI but should be using

closes ReactiveX#2389
@benlesh
Copy link
Member

benlesh commented May 21, 2018

This should be addressed with #3502

@benlesh benlesh closed this as completed May 21, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jun 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants