From 6439347a9221cc2818c560bafef95ec1e8e7a7ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Somhairle=20MacLe=C3=B2id?= Date: Thu, 9 Jan 2025 20:56:34 +0000 Subject: [PATCH] Remove CF-Connecting-IP for requests to the edge preview (#7712) * Remove CF-Connecting-IP for requests to the edge preview * Create honest-pillows-tease.md --- .changeset/honest-pillows-tease.md | 5 +++++ .../src/api/startDevWorker/RemoteRuntimeController.ts | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 .changeset/honest-pillows-tease.md diff --git a/.changeset/honest-pillows-tease.md b/.changeset/honest-pillows-tease.md new file mode 100644 index 000000000000..d131858d1950 --- /dev/null +++ b/.changeset/honest-pillows-tease.md @@ -0,0 +1,5 @@ +--- +"wrangler": patch +--- + +Remove CF-Connecting-IP for requests to the edge preview diff --git a/packages/wrangler/src/api/startDevWorker/RemoteRuntimeController.ts b/packages/wrangler/src/api/startDevWorker/RemoteRuntimeController.ts index fdff4625e3eb..1cae5c2be8aa 100644 --- a/packages/wrangler/src/api/startDevWorker/RemoteRuntimeController.ts +++ b/packages/wrangler/src/api/startDevWorker/RemoteRuntimeController.ts @@ -267,6 +267,9 @@ export class RemoteRuntimeController extends RuntimeController { ...(accessToken ? { Cookie: `CF_Authorization=${accessToken}` } : {}), + // Make sure we don't pass on CF-Connecting-IP to the remote edgeworker instance + // Without this line, remote previews will fail with `DNS points to prohibited IP` + "cf-connecting-ip": "", }, liveReload: config.dev.liveReload, proxyLogsToController: true,