mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
refactor: copy session/headers when building req
This commit is contained in:
@@ -35,7 +35,7 @@ exports.buildReqObject = (req, payload) => {
|
|||||||
params: req.params,
|
params: req.params,
|
||||||
method: req.method,
|
method: req.method,
|
||||||
body: payload || req.body,
|
body: payload || req.body,
|
||||||
session: session,
|
session: JSON.parse(JSON.stringify(session)),
|
||||||
ip: req.ip,
|
ip: req.ip,
|
||||||
host: host,
|
host: host,
|
||||||
protocol: encrypted ? 'https' : 'http',
|
protocol: encrypted ? 'https' : 'http',
|
||||||
@@ -44,7 +44,7 @@ exports.buildReqObject = (req, payload) => {
|
|||||||
path: referer.slice(referer.indexOf(host) + host.length),
|
path: referer.slice(referer.indexOf(host) + host.length),
|
||||||
baseUrl: req.baseUrl,
|
baseUrl: req.baseUrl,
|
||||||
originalUrl: req.originalUrl,
|
originalUrl: req.originalUrl,
|
||||||
headers: headers,
|
headers: { ...headers },
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user