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:
committed by
Maxime Thirouin
parent
75eddfcab6
commit
1e40a0d70b
@@ -22,6 +22,7 @@ module.exports = function(location, options, callback) {
|
|||||||
|
|
||||||
request.open(requestMethod.toUpperCase(), location, true)
|
request.open(requestMethod.toUpperCase(), location, true)
|
||||||
request.setRequestHeader("X-Requested-With", "XMLHttpRequest")
|
request.setRequestHeader("X-Requested-With", "XMLHttpRequest")
|
||||||
|
request.setRequestHeader("X-PJAX", "true")
|
||||||
|
|
||||||
// Add the request payload if available
|
// Add the request payload if available
|
||||||
if (options.requestPayloadString != undefined && options.requestPayloadString != "") {
|
if (options.requestPayloadString != undefined && options.requestPayloadString != "") {
|
||||||
|
|||||||
Reference in New Issue
Block a user