MoOx / pjax

Easily enable fast Ajax navigation on any website (using pushState + xhr)
MIT License
1.46k stars 125 forks source link

Ensure correct XHR encoding for multipart/form-data forms #174

Closed BehindTheMath closed 6 years ago

BehindTheMath commented 6 years ago

Fixes #168

robinnorth commented 6 years ago

Do we need to explicitly set the request's Content-Type to multipart/form-data when sending a request with FormData? I haven't had time to test this myself yet, sorry. Real life has been getting in the way of things lately!

BehindTheMath commented 6 years ago

Do we need to explicitly set the request's Content-Type to multipart/form-data when sending a request with FormData?

No. The [XHR spec](https://xhr.spec.whatwg.org/#the-send()-method) specifies that if the Content-Type is not explicitly set, it's inferred from the body.

robinnorth commented 6 years ago

Thanks for that spec link. Your change looks good to me given that clarification.