From 6f1d7dcb19cb4f231843eeabf25acc5cea29b2e8 Mon Sep 17 00:00:00 2001 From: Douglas DUTEIL Date: Thu, 17 Oct 2024 13:40:51 +0200 Subject: [PATCH] feat: allow cross origin resource access --- src/index.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/index.ts b/src/index.ts index 38a2b724f..a4bc14f64 100644 --- a/src/index.ts +++ b/src/index.ts @@ -215,6 +215,17 @@ let server: Server; oidcProvider.proxy = true; oidcProvider.use(connectionCountMiddleware); + app.use( + "/dist/mail-proconnect.png", + (req, res, next) => { + return helmet.crossOriginResourcePolicy({ + policy: "cross-origin", + })(req, res, next); + }, + express.static("dist/mail-proconnect.png", { + maxAge: NODE_ENV === "development" ? undefined : 7 * 24 * 60 * 60 * 1000, + }), + ); /* * `dist` folder is generated by vite. * Vite transforms js and css from /assets to /dist,