(req: express.Request, _?: express.Response, next?: express.NextFunction)
| 79 | * Throw an error if proxy is not enabled. Call `next` if provided. |
| 80 | */ |
| 81 | export const ensureProxyEnabled = (req: express.Request, _?: express.Response, next?: express.NextFunction): void => { |
| 82 | if (!proxyEnabled(req)) { |
| 83 | throw new HttpError("Forbidden", HttpCode.Forbidden) |
| 84 | } |
| 85 | if (next) { |
| 86 | next() |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * Return true if proxy is enabled. |
no test coverage detected