Check X-Forwarded-For on sockets (resolves #528)
This commit is contained in:
parent
432ee7bc30
commit
bfe76dae0e
3 changed files with 42 additions and 4 deletions
|
|
@ -35,6 +35,9 @@ export default function initialize(app, webConfig) {
|
|||
if (isTrustedProxy(req.ip)) {
|
||||
req.realIP = getForwardedIP(req);
|
||||
req.realProtocol = getForwardedProto(req);
|
||||
} else {
|
||||
req.realIP = req.ip;
|
||||
req.realProtocol = req.protocol;
|
||||
}
|
||||
|
||||
next();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue