Skip to content

Commit b3315ea

Browse files
committed
fix: coerce TRUST_PROXY to integer before passing to Express
1 parent a3b7943 commit b3315ea

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/middleware.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const app = express();
5555
// This also silences the express-rate-limit ValidationError that fires
5656
// when X-Forwarded-For is present but trust proxy is disabled.
5757
// Never use `true`; it trusts the user-supplied leftmost IP.
58-
const trustProxy = getConfig().APP.TRUST_PROXY ?? 0;
58+
const trustProxy = parseInt(getConfig().APP.TRUST_PROXY ?? 0, 10);
5959
app.set('trust proxy', trustProxy);
6060

6161
app.use(

0 commit comments

Comments
 (0)