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.
This commit was merged in pull request #80.
This commit is contained in:
Bradley B Smith
2017-12-19 07:56:30 -05:00
committed by Maxime Thirouin
parent 75eddfcab6
commit 1e40a0d70b

View File

@@ -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 != "") {