Skip to content

Commit

Permalink
Merge pull request #642 from SDekkers/request_xmlhttprequest
Browse files Browse the repository at this point in the history
Forcing Vue to use the X-Requested-With header, set to XMLHttpRequest
  • Loading branch information
taylorotwell authored Aug 5, 2019
2 parents 7268aad + a470c39 commit 7cc4abc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ require('bootstrap');

let token = document.head.querySelector('meta[name="csrf-token"]');

axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

if (token) {
axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
}
Expand Down

0 comments on commit 7cc4abc

Please sign in to comment.