Skip to content

Commit

Permalink
fix(netlify-edge): polyfill missing x-forwarded-proto header
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed May 16, 2023
1 parent 1c88e5e commit 4e5f46e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/runtime/entries/netlify-edge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export default async function (request: Request, _context) {
return;
}

if (!request.headers.has("x-forwarded-proto") && url.protocol === "https:") {
request.headers.set("x-forwarded-proto", "https");
}

let body;
if (request.body) {
body = await request.arrayBuffer();
Expand Down

0 comments on commit 4e5f46e

Please sign in to comment.