nuxt-i18n
Advanced tools
Comparing version 2.5.0 to 2.5.1
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="2.5.1"></a> | ||
## [2.5.1](https://github.com/nuxt-community/nuxt-i18n/compare/v2.5.0...v2.5.1) (2018-03-10) | ||
### Bug Fixes | ||
* Check req.headers.cookie before parsing ([0e3dad8](https://github.com/nuxt-community/nuxt-i18n/commit/0e3dad8)) | ||
<a name="2.5.0"></a> | ||
@@ -7,0 +17,0 @@ # [2.5.0](https://github.com/nuxt-community/nuxt-i18n/compare/v2.4.1...v2.5.0) (2018-03-10) |
@@ -1,2 +0,3 @@ | ||
import cookie from 'cookie'; | ||
import cookie from 'cookie' | ||
import { has } from 'lodash' | ||
import middleware from './middleware' | ||
@@ -22,3 +23,3 @@ | ||
const cookieKey = '<%= options.redirectCookieKey %>'; | ||
const cookies = cookie.parse(req.headers.cookie); | ||
const cookies = has(req, 'headers.cookie') ? cookie.parse(req.headers.cookie) : {}; | ||
// Redirect only if cookie not set yet | ||
@@ -25,0 +26,0 @@ if (!cookies[cookieKey]) { |
{ | ||
"name": "nuxt-i18n", | ||
"version": "2.5.0", | ||
"version": "2.5.1", | ||
"description": "i18n for Nuxt", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
31940
349