From c53e6e4cbe30568bd89aebb5167254dcc3489a5c Mon Sep 17 00:00:00 2001 From: Behind The Math Date: Mon, 13 Aug 2018 20:55:02 -0400 Subject: [PATCH] Ensure correct XHR encoding for multipart/form-data forms 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") } -- 2.49.1