Skip to content

Commit 565e05c

Browse files
authored
Ignore cf loop headers (#33)
* fix: ignore cf loop headers * fix: ignore render-proxy-ttl header * fix: add references for ignored headers
1 parent f884e24 commit 565e05c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/workflow-requests.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,16 @@ export const recreateUserHeaders = (headers: Headers): Headers => {
164164
const headerLowerCase = header.toLowerCase();
165165
if (
166166
!headerLowerCase.startsWith("upstash-workflow-") &&
167+
// https://vercel.com/docs/edge-network/headers/request-headers#x-vercel-id
167168
!headerLowerCase.startsWith("x-vercel-") &&
168169
!headerLowerCase.startsWith("x-forwarded-") &&
169-
headerLowerCase !== "cf-connecting-ip"
170+
// https://blog.cloudflare.com/preventing-request-loops-using-cdn-loop/
171+
headerLowerCase !== "cf-connecting-ip" &&
172+
headerLowerCase !== "cdn-loop" &&
173+
headerLowerCase !== "cf-ew-via" &&
174+
headerLowerCase !== "cf-ray" &&
175+
// For Render https://render.com
176+
headerLowerCase !== "render-proxy-ttl"
170177
) {
171178
filteredHeaders.append(header, value);
172179
}

0 commit comments

Comments
 (0)