diff --git a/test/fixture/nuxt.config.js b/test/fixture/nuxt.config.js index f09b76e..40900ec 100644 --- a/test/fixture/nuxt.config.js +++ b/test/fixture/nuxt.config.js @@ -11,12 +11,12 @@ module.exports = { { handler: require('../../') } ], serverMiddleware: ['~/api.js'], - axios: { + http: { prefix: '/test_api', proxy: true, credentials: true, debug: true, retry: true }, - plugins: ['~/plugins/axios'] + plugins: ['~/plugins/http'] } diff --git a/test/fixture/plugins/axios.js b/test/fixture/plugins/http.js similarity index 76% rename from test/fixture/plugins/axios.js rename to test/fixture/plugins/http.js index b498340..4d82857 100644 --- a/test/fixture/plugins/axios.js +++ b/test/fixture/plugins/http.js @@ -1,8 +1,8 @@ export default function ({ $http, redirect }) { + $http.setHeader('xsrfHeaderName', 'X-CSRF-TOKEN') + $http.onRequest((config) => { // eslint-disable-next-line no-console console.log('SPY: ' + config.url) - - $http.defaults.xsrfHeaderName = 'X-CSRF-TOKEN' }) }