mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-06 22:20:55 +03: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';
|
||||
return next();
|
||||
}
|
||||
const langs = header.replace(/\s/g, '').match(acceptLanguages);
|
||||
const langs = header.replace(/\s/g, '').match(acceptLanguages) || ['en-US'];
|
||||
const preferred = langs
|
||||
.map(l => {
|
||||
const parts = l.split(';');
|
||||
|
||||
Reference in New Issue
Block a user