Skip to content

Commit

Permalink
Allow x-Origin header which indicates processed by origin (#26)
Browse files Browse the repository at this point in the history
Co-authored-by: Jon Breen <[email protected]>
  • Loading branch information
cultpodcasts and cultpodcasts committed May 22, 2024
1 parent 140cafc commit c018e97
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ app.use('/*', cors({
allowMethods: ['GET', 'HEAD', 'POST', 'OPTIONS'],
maxAge: 86400,
credentials: true,
exposeHeaders: ['X-Origin']
}))

app.get('/homepage', async (c) => {
Expand Down Expand Up @@ -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}'.`);
Expand Down

0 comments on commit c018e97

Please sign in to comment.