mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-07 12:07:07 +03:00
Added string check to getIP
This commit is contained in:
committed by
GitHub
parent
9a317a2c23
commit
ad7d1a53d9
@@ -2,7 +2,7 @@ var fs = require('fs');
|
|||||||
var config = require('../config.js');
|
var config = require('../config.js');
|
||||||
|
|
||||||
module.exports = function getIP(req) {
|
module.exports = function getIP(req) {
|
||||||
if (config.behindProxy === true) config.behindProxy = "X-Forwarded-For";
|
if (config.behindProxy === true || config.behindProxy === "true") config.behindProxy = "X-Forwarded-For";
|
||||||
|
|
||||||
switch (config.behindProxy) {
|
switch (config.behindProxy) {
|
||||||
case "X-Forwarded-For":
|
case "X-Forwarded-For":
|
||||||
@@ -14,4 +14,4 @@ module.exports = function getIP(req) {
|
|||||||
default:
|
default:
|
||||||
return req.connection.remoteAddress;
|
return req.connection.remoteAddress;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user