Skip to content

Commit

Permalink
Ignore cf loop headers (#33)
Browse files Browse the repository at this point in the history
* fix: ignore cf loop headers

* fix: ignore render-proxy-ttl header

* fix: add references for ignored headers
  • Loading branch information
CahidArda authored Dec 4, 2024
1 parent f884e24 commit 565e05c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/workflow-requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,16 @@ export const recreateUserHeaders = (headers: Headers): Headers => {
const headerLowerCase = header.toLowerCase();
if (
!headerLowerCase.startsWith("upstash-workflow-") &&
// https://vercel.com/docs/edge-network/headers/request-headers#x-vercel-id
!headerLowerCase.startsWith("x-vercel-") &&
!headerLowerCase.startsWith("x-forwarded-") &&
headerLowerCase !== "cf-connecting-ip"
// https://blog.cloudflare.com/preventing-request-loops-using-cdn-loop/
headerLowerCase !== "cf-connecting-ip" &&
headerLowerCase !== "cdn-loop" &&
headerLowerCase !== "cf-ew-via" &&
headerLowerCase !== "cf-ray" &&
// For Render https://render.com
headerLowerCase !== "render-proxy-ttl"
) {
filteredHeaders.append(header, value);
}
Expand Down

0 comments on commit 565e05c

Please sign in to comment.