diff --git a/src/config-manager.ts b/src/config-manager.ts index 9b6aef9..8434932 100644 --- a/src/config-manager.ts +++ b/src/config-manager.ts @@ -96,7 +96,7 @@ if (process.env.PN_ACT_CONFIG_STRIPE_SECRET_KEY) { }; } -// Add the old config option for backwards compatibility +// * Add the old config option for backwards compatibility if (config.cdn.subdomain) { config.domains.cdn.push(config.cdn.subdomain); } diff --git a/src/middleware/host-limit.ts b/src/middleware/host-limit.ts index 4716de2..6e946da 100644 --- a/src/middleware/host-limit.ts +++ b/src/middleware/host-limit.ts @@ -3,10 +3,11 @@ import express from 'express'; export function restrictHostnames( allowedHostnames: string[], fn: TFn -): (req: express.Request, res: express.Response, next: () => void) => void | TFn { - return (req: express.Request, res: express.Response, next: () => void) => { - if (!allowedHostnames.includes(req.hostname)) { - return fn(req, res, next); +): (request: express.Request, response: express.Response, next: () => void) => void | TFn { + return (request: express.Request, response: express.Response, next: () => void) => { + if (!allowedHostnames.includes(request.hostname)) { + return fn(request, response, next); + } return next();