mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-09-19 12:04:48 -04:00
Use Settings.get
This commit is contained in:
parent
a3b1612938
commit
2389b604fe
2 changed files with 3 additions and 2 deletions
|
@ -8,7 +8,7 @@ const { log } = require("../src/util");
|
|||
const Database = require("./database");
|
||||
const util = require("util");
|
||||
const { CacheableDnsHttpAgent } = require("./cacheable-dns-http-agent");
|
||||
const { setting } = require("./util-server");
|
||||
const { Settings } = require("./settings");
|
||||
|
||||
/**
|
||||
* `module.exports` (alias: `server`) should be inside this class, in order to avoid circular dependency issue.
|
||||
|
@ -133,7 +133,7 @@ class UptimeKumaServer {
|
|||
async getClientIP(socket) {
|
||||
const clientIP = socket.client.conn.remoteAddress.replace(/^.*:/, "");
|
||||
|
||||
if (await setting("trustProxy")) {
|
||||
if (await Settings.get("trustProxy")) {
|
||||
return socket.client.conn.request.headers["x-forwarded-for"]
|
||||
|| socket.client.conn.request.headers["x-real-ip"]
|
||||
|| clientIP;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue