Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Loop Detection issues in Cloudflare and Render #33

Merged
merged 3 commits into from
Dec 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/workflow-requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,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
Loading