From 9682fcf22b41abb71d4b8fda2a9718c4abd5d3f0 Mon Sep 17 00:00:00 2001 From: Isaac Date: Fri, 30 Sep 2022 16:58:31 +0100 Subject: [PATCH] trust proxy --- src/http.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/http.js b/src/http.js index e216246..422b2cc 100644 --- a/src/http.js +++ b/src/http.js @@ -1,4 +1,4 @@ -const fastify = require('fastify')(); +const fastify = require('fastify')({ trustProxy: true }); const oauth = require('@fastify/oauth2'); const { domain } = require('./lib/http'); const { short } = require('leeks.js'); @@ -165,6 +165,7 @@ module.exports = async client => { // express server for settings const express = require('express')(); const { handler } = await import('@discord-tickets/settings/build/handler.js'); + express.set('trust proxy', true); express.use((req, res, next) => { next(); client.log.verbose.http(short(`Express ${req.ip} ${req.method} ${req.route?.path ?? req.path}`));