From 6bfa4ec1ea35a48854764b53a235949265bc959c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Mon, 15 Jan 2024 12:37:48 +0000 Subject: [PATCH] fix(wip): Revert to dynamic origin header --- api.planx.uk/server.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api.planx.uk/server.ts b/api.planx.uk/server.ts index 0016cd8659..bacdc9c4ba 100644 --- a/api.planx.uk/server.ts +++ b/api.planx.uk/server.ts @@ -38,11 +38,15 @@ useSwaggerDocs(app); app.set("trust proxy", 1); +app.use((req, res, next) => { + res.header("Access-Control-Allow-Origin", req.headers.origin); + next(); +}); + app.use( cors({ credentials: true, methods: "*", - origin: process.env.EDITOR_URL_EXT, allowedHeaders: [ "Accept", "Authorization",