mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-24 16:38:41 +03:00
Added DB checks to tests and fixed getIP using the wrong config
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
var fs = require('fs');
|
||||
var config = undefined;
|
||||
|
||||
console.log(process.env.npm_lifecycle_script)
|
||||
|
||||
// Check to see if launched in test mode
|
||||
if (process.env.npm_lifecycle_script === 'node test.js') {
|
||||
config = JSON.parse(fs.readFileSync('test.json'));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
var fs = require('fs');
|
||||
var config = JSON.parse(fs.readFileSync('config.json'));
|
||||
var config = require('./config.js');
|
||||
|
||||
module.exports = function getIP(req) {
|
||||
return config.behindProxy ? req.headers['x-forwarded-for'] : req.connection.remoteAddress;
|
||||
|
||||
Reference in New Issue
Block a user