-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Observable Ajax POST with wrong Content-Type after PUT #2801
Labels
bug
Confirmed bug
Comments
@nelsondaza Thanks a lot !! if you'd hadn't mentioned that it was mutating the headers object I would've stayed on this bug till the ends of time ! +1 this needs to be fixed |
89 tasks
benlesh
added a commit
to benlesh/rxjs
that referenced
this issue
Aug 20, 2020
- Also ensures x-requested-with header is set properly - Adds comments - Code clean up - Normalize headers to be lowercase, since they are case insensitive. - Updates tests - Remove superfluous checks in unsubscribe resolves ReactiveX#2801
benlesh
added a commit
to benlesh/rxjs
that referenced
this issue
Sep 3, 2020
- Also ensures x-requested-with header is set properly - Adds comments - Code clean up - Normalize headers to be lowercase, since they are case insensitive. - Updates tests - Remove superfluous checks in unsubscribe resolves ReactiveX#2801
benlesh
added a commit
to benlesh/rxjs
that referenced
this issue
Sep 3, 2020
- Also ensures x-requested-with header is set properly - Adds comments - Code clean up - Normalize headers to be lowercase, since they are case insensitive. - Updates tests - Remove superfluous checks in unsubscribe resolves ReactiveX#2801
benlesh
added a commit
that referenced
this issue
Sep 3, 2020
- Also ensures x-requested-with header is set properly - Adds comments - Code clean up - Normalize headers to be lowercase, since they are case insensitive. - Updates tests - Remove superfluous checks in unsubscribe resolves #2801
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to upload an image but I found that, every now and then, the server says that the binary image was not sent.
After some tests I found that the POST calls stops working after a PUT call and that is because the "Content-Type" of the PUT remains in the Request Headers. Those calls are not mapped, chained or consecutive, simply different user actions.
I've made some changes to AjaxObservable.ts but don't know if it is the right solution.
RxJS version:
5.4.3
Code to reproduce:
The POST code goes something like this:
The PUT code goes something like this:
Expected behavior:
I expected the Content-Type header to change according to the method, like.
Actual behavior:
The 3rd call has the binary data but the wrong Content-Type so the server won't get it.
My actual solution:
I just found that Rx is mutating the HEADERS object passed as parameter adding a Content-Type attribute that is used in the next requests.
Passing a new object each time will do the trick.
The issue was solved, maybe this helps some one or you can guide me to the right solution.
The text was updated successfully, but these errors were encountered: