From 6f39767cf950b3e3a65f5cc72727866ba4c1f96d Mon Sep 17 00:00:00 2001 From: BehindTheMath <9314934+BehindTheMath@users.noreply.github.com> Date: Wed, 15 Aug 2018 15:07:04 -0400 Subject: [PATCH] Ensure correct XHR encoding for multipart/form-data forms (#174) Fixes #168 --- lib/send-request.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/send-request.js b/lib/send-request.js index 11b88c4..916d6c3 100644 --- a/lib/send-request.js +++ b/lib/send-request.js @@ -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") }