Skip to content

Fix cloudflare.ray_id not being set correctly for subrequests#6425

Merged
danlapid merged 1 commit intocloudflare:mainfrom
WalshyDev:walshy/fix-rayid-subrequests
Mar 26, 2026
Merged

Fix cloudflare.ray_id not being set correctly for subrequests#6425
danlapid merged 1 commit intocloudflare:mainfrom
WalshyDev:walshy/fix-rayid-subrequests

Conversation

@WalshyDev
Copy link
Copy Markdown
Member

We were previously setting cloudflare.ray_id to the request cf-ray header if present and ONLY if there was a request body.

This is incorrect. We want to set it to the response header and always not only if there is a body.

This moves the ray setting down to where the response is returned and ensures it is properly set when expected

@WalshyDev WalshyDev requested review from a team as code owners March 26, 2026 10:55
We were previously setting `cloudflare.ray_id` to the _request_ cf-ray header
if present and ONLY if there was a request body.

This is incorrect. We want to set it to the _response_ header and always not
only if there is a body.

This moves the ray setting down to where the response is returned and ensures
it is properly set when expected
@WalshyDev WalshyDev force-pushed the walshy/fix-rayid-subrequests branch from e757e18 to 2e6785d Compare March 26, 2026 11:07
@danlapid danlapid merged commit 8c8b10a into cloudflare:main Mar 26, 2026
33 of 35 checks passed
@WalshyDev WalshyDev deleted the walshy/fix-rayid-subrequests branch March 26, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants