Skip to content

Commit

Permalink
Proxy submit-post response (#27)
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 23, 2024
1 parent c018e97 commit 98b91f6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,10 @@ 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");
return resp;
var response = new Response(resp.body);
response.headers.set("content-type", "application/json; charset=utf-8");
response.headers.set("X-Origin", "true");
return response;
} else {
console.log(`Failed to use secure-submit-endpoint. Response code: '${resp.status}'.`);
}
Expand Down

0 comments on commit 98b91f6

Please sign in to comment.