Forward all viewer headers/cookies/query strings on uncached CloudFront routes#11697
Merged
Conversation
…nt routes Replaces the overly-restrictive forward_host and forward_host_with_refresh_cookie origin request policies (which only whitelisted the Host header) with a single forward_all policy using allViewer for headers, cookies, and query strings. Previously, headers like User-Agent were stripped before reaching Rails, so Sentry events from server-side errors lacked browser context. Since all affected behaviors use the no-cache cache policy (TTL=0), there is no caching tradeoff. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Code Coverage Report: Only Changed Files listed
Minimum allowed coverage is |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
forward_hostandforward_host_with_refresh_cookie) with a singleforward_allpolicy usingallViewerfor headers, cookies, and query stringsUser-Agentand all other viewer headers were stripped before reaching Rails, so Sentry events from server-side errors lacked browser/OS contextWhy no caching tradeoff
All affected behaviors use the
no_cachecache policy (TTL=0), so there is nothing to protect — the restrictive whitelist had no benefit, only cost.The
og_shellcached behavior is unchanged and still uses its own restrictive policy, where the whitelist is load-bearing for cache hit rates.Test plan
terraform planshows the two old policies destroyed and one new policy created, with the four affected behaviors updated to reference the new policy🤖 Generated with Claude Code