"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const http_1 = require("@deepkit/http");
const resolver_1 = require("../app/resolver");
/**
 * HttpRequest.getRemoteAddress
 * override to enable x-real-ip header
 */
let useRealIpHeader = null;
http_1.HttpRequest.prototype.getRemoteAddress = function () {
    if (useRealIpHeader === null) {
        useRealIpHeader = !!(0, resolver_1.getAppConfig)().USE_REAL_IP_HEADER;
    }
    if (this.headers['x-real-ip'] && useRealIpHeader) {
        return this.headers['x-real-ip'];
    }
    return this.socket.remoteAddress ?? '';
};
//# sourceMappingURL=overrides.js.map