@nuxtjs/axios
Advanced tools
Comparing version 5.3.4 to 5.3.5
@@ -5,2 +5,13 @@ # Change Log | ||
<a name="5.3.5"></a> | ||
## [5.3.5](https://github.com/nuxt-community/axios-module/compare/v5.3.4...v5.3.5) (2018-11-07) | ||
### Bug Fixes | ||
* **defaults:** ignore `cf-ray` and `cf-connecting-ip` headers on server side ([#20](https://github.com/nuxt-community/axios-module/issues/20)) ([#175](https://github.com/nuxt-community/axios-module/issues/175)) ([3ae5416](https://github.com/nuxt-community/axios-module/commit/3ae5416)) | ||
* **defaults:** set proper Accept-Encoding for server side ([#176](https://github.com/nuxt-community/axios-module/issues/176)) ([c84fb56](https://github.com/nuxt-community/axios-module/commit/c84fb56)) | ||
<a name="5.3.4"></a> | ||
@@ -7,0 +18,0 @@ ## [5.3.4](https://github.com/nuxt-community/axios-module/compare/v5.3.3...v5.3.4) (2018-10-30) |
@@ -43,3 +43,3 @@ const path = require('path') | ||
proxyHeaders: true, | ||
proxyHeadersIgnore: ['accept', 'host'], | ||
proxyHeadersIgnore: ['accept', 'host', 'cf-ray', 'cf-connecting-ip'], | ||
proxy: false, | ||
@@ -46,0 +46,0 @@ retry: false, |
@@ -151,24 +151,31 @@ import Axios from 'axios' | ||
export default (ctx, inject) => { | ||
const axiosOptions = { | ||
// baseURL | ||
baseURL : process.browser | ||
// baseURL | ||
const baseURL = process.browser | ||
? '<%= options.browserBaseURL %>' | ||
: (process.env._AXIOS_BASE_URL_ || '<%= options.baseURL %>'), | ||
: (process.env._AXIOS_BASE_URL_ || '<%= options.baseURL %>') | ||
// Create fresh objects for all default header scopes | ||
// Axios creates only one which is shared across SSR requests! | ||
// https://github.com/mzabriskie/axios/blob/master/lib/defaults.js | ||
headers: { | ||
common : { | ||
'Accept': 'application/json, text/plain, */*' | ||
}, | ||
delete: {}, | ||
get: {}, | ||
head: {}, | ||
post: {}, | ||
put: {}, | ||
patch: {} | ||
} | ||
// Create fresh objects for all default header scopes | ||
// Axios creates only one which is shared across SSR requests! | ||
// https://github.com/mzabriskie/axios/blob/master/lib/defaults.js | ||
const headers = { | ||
common : { | ||
'Accept': 'application/json, text/plain, */*' | ||
}, | ||
delete: {}, | ||
get: {}, | ||
head: {}, | ||
post: {}, | ||
put: {}, | ||
patch: {} | ||
} | ||
if (process.server) { | ||
headers.common['Accept-Encoding'] = 'gzip, deflate' | ||
} | ||
const axiosOptions = { | ||
baseURL, | ||
headers | ||
} | ||
<% if (options.proxyHeaders) { %> | ||
@@ -175,0 +182,0 @@ // Proxy SSR request headers headers |
{ | ||
"name": "@nuxtjs/axios", | ||
"version": "5.3.4", | ||
"version": "5.3.5", | ||
"description": "Secure and easy axios integration with Nuxt.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27804
272