Skip to content

fix(xds): preserve original host metadata for DFP rewrites#8610

Open
officialasishkumar wants to merge 1 commit into
envoyproxy:mainfrom
officialasishkumar:fix/dfp-original-host-header
Open

fix(xds): preserve original host metadata for DFP rewrites#8610
officialasishkumar wants to merge 1 commit into
envoyproxy:mainfrom
officialasishkumar:fix/dfp-original-host-header

Conversation

@officialasishkumar
Copy link
Copy Markdown
Contributor

What type of PR is this?
fix(xds): preserve original host metadata for DFP rewrites

What this PR does / why we need it:
Dynamic forward proxy host rewrites were clearing the route-level host rewrite metadata after the per-route DFP config was added. That left Envoy without the router-level information it uses to emit X-ENVOY-ORIGINAL-HOST, even though the rewritten host still drove DNS resolution. This change keeps the route host rewrite metadata in place, adds a focused regression test for both header and literal rewrites, and updates the translator golden output accordingly.

Which issue(s) this PR fixes:
Fixes #8353

Release Notes: Yes

@officialasishkumar officialasishkumar requested a review from a team as a code owner March 28, 2026 15:58
@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 28, 2026

Deploy Preview for cerulean-figolla-1f9435 canceled.

Name Link
🔨 Latest commit f6a5cbc
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/69c920f91edbb100080f9a6f

@zirain
Copy link
Copy Markdown
Member

zirain commented Mar 29, 2026

are you sure that this fixed the issue?

Keep the route-level host rewrite metadata in place for dynamic forward proxy routes so Envoy can still emit the original host headers, while DFP per-route config continues to drive DNS resolution.

Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
@officialasishkumar officialasishkumar force-pushed the fix/dfp-original-host-header branch from 46cc646 to f6a5cbc Compare March 29, 2026 12:54
@officialasishkumar
Copy link
Copy Markdown
Contributor Author

@zirain yes

@zirain
Copy link
Copy Markdown
Member

zirain commented Mar 29, 2026

@zirain yes

I tested it locally, and it didn't find it worked(maybe i missed something).
So I would like to see an worked e2e.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.32%. Comparing base (b1d7302) to head (f6a5cbc).
⚠️ Report is 139 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8610      +/-   ##
==========================================
+ Coverage   74.29%   74.32%   +0.02%     
==========================================
  Files         243      243              
  Lines       38155    38150       -5     
==========================================
+ Hits        28347    28354       +7     
+ Misses       7815     7806       -9     
+ Partials     1993     1990       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zhaohuabing
Copy link
Copy Markdown
Member

zhaohuabing commented Mar 31, 2026

I haven’t verified this yet, but I’d expect X-ENVOY-ORIGINAL-HOST to reflect the DFP-rewritten host rather than the client’s original host, since the DFP filter updates the Host header before the request reaches the router.

This may require a change on the Envoy side to have the DFP filter set this header.

cc @wbpcode, who has more context here.

@github-actions
Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. Please feel free to give a status update now, ping for review, when it's ready. Thank you for your contributions!

@github-actions github-actions Bot added stale and removed stale labels Apr 30, 2026
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.

Missing X-ENVOY-ORIGINAL-HOST even with enableEnvoyHeaders: True

3 participants