i18next-express-middleware
Advanced tools
Comparing version 1.3.2 to 1.4.0
@@ -0,1 +1,5 @@ | ||
### 1.4.0 | ||
- Set Content-Language response header [PR159](https://github.com/i18next/i18next-express-middleware/pull/159) | ||
### 1.3.2 | ||
@@ -2,0 +6,0 @@ |
@@ -39,2 +39,5 @@ 'use strict'; | ||
req.language = req.locale = req.lng = lng; | ||
if (!res.headersSent) { | ||
res.set('Content-Language', lng); | ||
} | ||
req.languages = i18next.services.languageUtils.toResolveHierarchy(lng); | ||
@@ -51,2 +54,5 @@ if (i18next.services.languageDetector) { | ||
req.language = req.locale = req.lng = lng; | ||
if (!res.headersSent) { | ||
res.set('Content-Language', lng); | ||
} | ||
req.languages = i18next.services.languageUtils.toResolveHierarchy(lng); | ||
@@ -53,0 +59,0 @@ |
@@ -42,5 +42,16 @@ 'use strict'; | ||
cookies.set(options.lookupCookie, lng, { expires: expirationDate, domain: options.cookieDomain, httpOnly: false, overwrite: true }); | ||
var cookieOptions = { | ||
expires: expirationDate, | ||
domain: options.cookieDomain, | ||
httpOnly: false, | ||
overwrite: true | ||
}; | ||
if (options.hasOwnProperty('cookieSecure')) { | ||
cookieOptions.secure = options.cookieSecure; | ||
} | ||
cookies.set(options.lookupCookie, lng, cookieOptions); | ||
} | ||
} | ||
}; |
{ | ||
"name": "i18next-express-middleware", | ||
"version": "1.3.2", | ||
"version": "1.4.0", | ||
"description": "express middleware for i18next", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
27950
463
0