Skip to content

Commit

Permalink
Ensure correct XHR encoding for multipart/form-data forms (#174)
Browse files Browse the repository at this point in the history
Fixes #168
  • Loading branch information
BehindTheMath authored Aug 15, 2018
1 parent 03d6486 commit 6f39767
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/send-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module.exports = function(location, options, callback) {
request.setRequestHeader("X-PJAX-Selectors", JSON.stringify(options.selectors))

// Send the proper header information for POST forms
if (requestPayload && requestMethod === "POST") {
if (requestPayload && requestMethod === "POST" && !formData) {
request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
}

Expand Down

0 comments on commit 6f39767

Please sign in to comment.