diff --git a/src/routes/healthCheck.ts b/src/routes/healthCheck.ts index 9eccc2b6..e3a59fcf 100644 --- a/src/routes/healthCheck.ts +++ b/src/routes/healthCheck.ts @@ -5,11 +5,11 @@ export const healthCheckRouter: Router = express.Router() healthCheckRouter.get('/is-alive', (req: Request, res: Response) => { nestedCountersInstance.countEvent('api', 'is-alive') - return res.status(200); + return res.status(200) }) healthCheckRouter.get('/is-healthy', (req: Request, res: Response) => { // TODO: Add actual health check logic nestedCountersInstance.countEvent('api', 'health-check') - return res.status(200); -}) \ No newline at end of file + return res.status(200) +}) diff --git a/src/server.ts b/src/server.ts index 340841b4..77162baf 100644 --- a/src/server.ts +++ b/src/server.ts @@ -80,13 +80,16 @@ app.set('trust proxy', true) app.use(cors({ methods: ['POST'] })) app.use(express.json()) app.use(cookieParser()) -app.use(function(req, res, next) { - res.setHeader('X-Content-Type-Options', 'nosniff'); - res.setHeader('Permissions-Policy', 'accelerometer=(), ambient-light-sensor=(), autoplay=(), battery=(), camera=(), cross-origin-isolated=(), display-capture=(), document-domain=(), encrypted-media=(), execution-while-not-rendered=(), execution-while-out-of-viewport=(), fullscreen=(), geolocation=(), gyroscope=(), keyboard-map=(), magnetometer=(), microphone=(), midi=(), navigation-override=(), payment=(), picture-in-picture=(), publickey-credentials-get=(), screen-wake-lock=(), sync-xhr=(), usb=(), web-share=(), xr-spatial-tracking=(), clipboard-read=(), clipboard-write=(), gamepad=(), speaker-selection=(), conversion-measurement=(), focus-without-user-activation=(), hid=(), idle-detection=(), interest-cohort=(), serial=(), sync-script=(), trust-token-redemption=(), unload=(), window-placement=(), vertical-scroll=()'); - res.setHeader('X-Frame-Options', 'SAMEORIGIN'); - res.setHeader('Content-Security-Policy', "default-src 'self'"); - next(); -}); +app.use(function (req, res, next) { + res.setHeader('X-Content-Type-Options', 'nosniff') + res.setHeader( + 'Permissions-Policy', + 'accelerometer=(), ambient-light-sensor=(), autoplay=(), battery=(), camera=(), cross-origin-isolated=(), display-capture=(), document-domain=(), encrypted-media=(), execution-while-not-rendered=(), execution-while-out-of-viewport=(), fullscreen=(), geolocation=(), gyroscope=(), keyboard-map=(), magnetometer=(), microphone=(), midi=(), navigation-override=(), payment=(), picture-in-picture=(), publickey-credentials-get=(), screen-wake-lock=(), sync-xhr=(), usb=(), web-share=(), xr-spatial-tracking=(), clipboard-read=(), clipboard-write=(), gamepad=(), speaker-selection=(), conversion-measurement=(), focus-without-user-activation=(), hid=(), idle-detection=(), interest-cohort=(), serial=(), sync-script=(), trust-token-redemption=(), unload=(), window-placement=(), vertical-scroll=()' + ) + res.setHeader('X-Frame-Options', 'SAMEORIGIN') + res.setHeader('Content-Security-Policy', "default-src 'self'") + next() +}) if (config.dashboard.enabled && config.dashboard.dist_path) { const clientDirectory =