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

Merged
BehindTheMath merged 1 commits from fix/multipart-form-data into master 2018-08-15 14:07:04 -05:00
BehindTheMath commented 2018-08-13 19:55:37 -05:00 (Migrated from github.com)

Fixes #168

Fixes #168
robinnorth commented 2018-08-15 04:28:03 -05:00 (Migrated from github.com)

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!

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 2018-08-15 08:33:24 -05:00 (Migrated from github.com)

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 specifies that if the Content-Type is not explicitly set, it's inferred from the body.

>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 2018-08-15 08:48:45 -05:00 (Migrated from github.com)

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

Thanks for that spec link. Your change looks good to me given that clarification.
robinnorth (Migrated from github.com) approved these changes 2018-08-15 08:49:09 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: iLoveElysia/pjax#174