Skip to content

Commit 460a57d

Browse files
author
Joseph F
committed
Added X-Requested-With header
1 parent 5500175 commit 460a57d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

js/page-load.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,9 @@ function request( url, responseType, onLoad, onError ) {
267267
// set responseType document to return DOM
268268
req.responseType = responseType || '';
269269

270+
// set X-Requested-With header to check that is ajax request
271+
req.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
272+
270273
req.onload = function() {
271274
if ( req.status == 200 ) {
272275
onLoad( req.response );

0 commit comments

Comments
 (0)