From 1e40a0d70bbfa2618f083a527551e61bb43e312a Mon Sep 17 00:00:00 2001 From: Bradley B Smith Date: Tue, 19 Dec 2017 07:56:30 -0500 Subject: [PATCH] Send the X-PJAX header with request (#80) Make it more compatible with the jQuery PJAX and lets the server choose to optimize the response. Sending the list of selectors would be nice, too. --- lib/request.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/request.js b/lib/request.js index da83e71..2054b6d 100644 --- a/lib/request.js +++ b/lib/request.js @@ -22,6 +22,7 @@ module.exports = function(location, options, callback) { request.open(requestMethod.toUpperCase(), location, true) request.setRequestHeader("X-Requested-With", "XMLHttpRequest") + request.setRequestHeader("X-PJAX", "true") // Add the request payload if available if (options.requestPayloadString != undefined && options.requestPayloadString != "") {