[misc] work around context assignments by i18n that leak across requests

Somewhere in i18next there is an assignment `ctx.lng=someLang` that
 leaks across requests that share the same `ctx` object for calls like
 `req.i18n.translate('locale', ctx)`.

This somewhere is likely here:
6cc8917ed5/src/i18next.translate.js (L338)

GitOrigin-RevId: b05f62fa59a6ffa59724108fbcc68cc7a67cfd8f
This commit is contained in:
Jakob Ackermann 2020-06-10 11:22:50 +01:00 committed by Copybot
parent a078a34e75
commit 1eadf38761

View file

@ -215,7 +215,7 @@ const UserPagesController = {
const data = providers[provider]
data.description = req.i18n.translate(
data.descriptionKey,
data.descriptionOptions
Object.assign({}, data.descriptionOptions)
)
result[provider] = data
}