Skip to content

Commit 0d31e29

Browse files
committed
Add to axios defaults instead of overwriting them
This change ensures the default "Accept" header specified by axios is retained.
1 parent f7b9a59 commit 0d31e29

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

resources/assets/js/bootstrap.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ window.Vue = require('vue');
2727

2828
window.axios = require('axios');
2929

30-
window.axios.defaults.headers.common = {
31-
'X-CSRF-TOKEN': window.Laravel.csrfToken,
32-
'X-Requested-With': 'XMLHttpRequest'
33-
};
30+
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = window.Laravel.csrfToken;
31+
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
3432

3533
/**
3634
* Echo exposes an expressive API for subscribing to channels and listening

0 commit comments

Comments
 (0)