Skip to content
Permalink
Browse files

fix: lowercase `accept-encoding` header (nuxt/http#43)

  • Loading branch information...
pi0 committed May 22, 2019
1 parent d0982b6 commit c17fec2db627442c41a806886293de8d484308cd
Showing with 12 additions and 12 deletions.
  1. +1 −1 lib/plugin.js
  2. +11 −11 test/fixture/pages/ssr.vue
@@ -181,7 +181,7 @@ export default (ctx, inject) => {

if (process.server) {
// Don't accept brotli encoding because Node can't parse it
axiosOptions.headers.common['Accept-Encoding'] = 'gzip, deflate'
axiosOptions.headers.common['accept-encoding'] = 'gzip, deflate'
}

// Create new axios instance
@@ -6,24 +6,24 @@
</template>

<script>
// This will be intentically shared across requests
let reqCtr = 1
// This will be intentically shared across requests
let reqCtr = 1
export default {
async fetch({app, route}) {
let doLogin = route.query.login !== undefined
if (doLogin) {
app.$axios.setHeader('sessionId', reqCtr++)
}
},
export default {
computed: {
axiosSessionId() {
return this.$axios.defaults.headers.common.sessionId
},
axiosEncoding() {
return this.$axios.defaults.headers.common['Accept-Encoding']
return this.$axios.defaults.headers.common['accept-encoding']
}
},
async fetch({app, route}) {
let doLogin = route.query.login !== undefined
if (doLogin) {
app.$axios.setHeader('sessionId', reqCtr++)
}
}
}
}
</script>

0 comments on commit c17fec2

Please sign in to comment.
You can’t perform that action at this time.