Skip to content

Commit

Permalink
fix(wip): Revert to dynamic origin header
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Jan 15, 2024
1 parent f34adf1 commit 6bfa4ec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api.planx.uk/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 6bfa4ec

Please sign in to comment.