diff --git a/src/middleware/applyProductionSecurity.js b/src/middleware/applyProductionSecurity.js index 19c3a8f..414fce5 100644 --- a/src/middleware/applyProductionSecurity.js +++ b/src/middleware/applyProductionSecurity.js @@ -22,10 +22,15 @@ xssSanitizer, // rateLimit middleware can be added here (req, res, next) => { + const isHealthcheck = req.method === "HEAD" && req.path === "/healthcheck"; + if (isHealthcheck) return next(); + const host = req.hostname; if (["127.0.0.1", "localhost"].includes(host)) { + req.log.info(`Method: ${req.method} Path ${req.path}`); return next(new HttpError("Forbidden", 403)); } + next(); }, helmet.hsts({ maxAge: 63072000 }),