Skip to content

Commit

Permalink
fix: lowercase accept-encoding header (nuxt/http#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
pooya parsa committed May 22, 2019
1 parent d0982b6 commit c17fec2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions test/fixture/pages/ssr.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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.