mirror of
https://github.com/PretendoNetwork/account.git
synced 2026-09-30 22:28:00 -05:00
Apply suggestions from code review
Co-authored-by: Jonathan Barrow <jonbarrow1998@gmail.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -3,10 +3,11 @@ import express from 'express';
|
||||
export function restrictHostnames<TFn extends express.Router>(
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user