Closed davidSocast closed 6 years ago
Hi @davidSocast, thanks for reporting this. Yes, looks like this is a bug as the Content-Type
header is currently always set to "application/x-www-form-urlencoded"
when submitting a form:
We'll look to fix this in the next release of the library.
The fix for this should be simple: just add && !formData
to the if
statement. However, when I started writing tests for this, I ran into what I think is a bug in jsdom. So I'm going to wait until that's resolved to work on this.
The issue I opened in jsdom has not had a response in 3 weeks, so I'm submitting the fix for this, and the tests will have to wait.
Hi guys, i've been struggling with something that i believe is a bug on this excellent library:
From the previous threads and the documentation, my understanding was that forms submitted through pjax are submitted with a content type set to "application/x-www-form-urlencoded".
However, if the form has a enctype set to "multipart/form-data", the pjax call is supposed to use this value and set the header Content-Type to this value.
I can't make it work on my server (Apache/PHP7) and despite the required enctype my data are sent as "application/x-www-form-urlencoded".
the formData is set properly, and using the debug mode, i can see that the reight object is used to pass the form data to my backend.
But when i look to the post request, the content-type is not changed, so my PHP script cannot handle the data properly.
find a the following capture describing what i believe is an issue :