mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-12 06:27:10 +03:00
Changed getIP to be all lowercase
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
var fs = require('fs');
|
|
||||||
var config = require('../config.js');
|
var config = require('../config.js');
|
||||||
|
|
||||||
module.exports = function getIP(req) {
|
module.exports = function getIP(req) {
|
||||||
@@ -6,11 +5,11 @@ module.exports = function getIP(req) {
|
|||||||
|
|
||||||
switch (config.behindProxy) {
|
switch (config.behindProxy) {
|
||||||
case "X-Forwarded-For":
|
case "X-Forwarded-For":
|
||||||
return req.headers['X-Forwarded-For'];
|
return req.headers['x-forwarded-for'];
|
||||||
case "Cloudflare":
|
case "Cloudflare":
|
||||||
return req.headers['CF-Connecting-IP'];
|
return req.headers['cf-connecting-ip'];
|
||||||
case "X-Real-IP":
|
case "X-Real-IP":
|
||||||
return req.headers['X-Real-IP'];
|
return req.headers['x-real-ip'];
|
||||||
default:
|
default:
|
||||||
return req.connection.remoteAddress;
|
return req.connection.remoteAddress;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user