mirror of
https://github.com/timvisee/send.git
synced 2026-04-18 21:54:11 -04:00
default accept-language to en-US when regexp does not match
This commit is contained in:
@@ -24,7 +24,7 @@ module.exports = function(req, res, next) {
|
|||||||
req.language = 'en-US';
|
req.language = 'en-US';
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
const langs = header.replace(/\s/g, '').match(acceptLanguages);
|
const langs = header.replace(/\s/g, '').match(acceptLanguages) || ['en-US'];
|
||||||
const preferred = langs
|
const preferred = langs
|
||||||
.map(l => {
|
.map(l => {
|
||||||
const parts = l.split(';');
|
const parts = l.split(';');
|
||||||
|
|||||||
Reference in New Issue
Block a user