From c018e976d6120433963856d7f33c3a72aeab47a6 Mon Sep 17 00:00:00 2001 From: CultPodcastsBot <142722442+cultpodcasts@users.noreply.github.com> Date: Wed, 22 May 2024 21:28:34 +0100 Subject: [PATCH] Allow x-Origin header which indicates processed by origin (#26) Co-authored-by: Jon Breen --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 5ba351a..2df10d8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -68,6 +68,7 @@ app.use('/*', cors({ allowMethods: ['GET', 'HEAD', 'POST', 'OPTIONS'], maxAge: 86400, credentials: true, + exposeHeaders: ['X-Origin'] })) app.get('/homepage', async (c) => { @@ -305,7 +306,7 @@ app.post("/submit", auth0Middleware, async (c) => { if (resp.status == 200) { console.log(`Successfully used secure-submit-endpoint.`); const resp = c.json({ success: "Submitted" }); - resp.headers.set("x-origin", "true"); + resp.headers.set("X-Origin", "true"); return resp; } else { console.log(`Failed to use secure-submit-endpoint. Response code: '${resp.status}'.`);