From 0d31e2993b3ee681f4aeef486619c90a26f9086e Mon Sep 17 00:00:00 2001 From: Matt Isenhower Date: Thu, 6 Apr 2017 15:58:57 -0700 Subject: [PATCH] Add to axios defaults instead of overwriting them This change ensures the default "Accept" header specified by axios is retained. --- resources/assets/js/bootstrap.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/resources/assets/js/bootstrap.js b/resources/assets/js/bootstrap.js index 36ec688c495..865748399d7 100644 --- a/resources/assets/js/bootstrap.js +++ b/resources/assets/js/bootstrap.js @@ -27,10 +27,8 @@ window.Vue = require('vue'); window.axios = require('axios'); -window.axios.defaults.headers.common = { - 'X-CSRF-TOKEN': window.Laravel.csrfToken, - 'X-Requested-With': 'XMLHttpRequest' -}; +window.axios.defaults.headers.common['X-CSRF-TOKEN'] = window.Laravel.csrfToken; +window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; /** * Echo exposes an expressive API for subscribing to channels and listening