Skip to content

fix: filter hop-by-hop headers in dev server proxy (#24092) (CP: 25.0)#24100

Merged
caalador merged 1 commit into25.0from
cherry/cherrypick-24092-to-25.0
Apr 10, 2026
Merged

fix: filter hop-by-hop headers in dev server proxy (#24092) (CP: 25.0)#24100
caalador merged 1 commit into25.0from
cherry/cherrypick-24092-to-25.0

Conversation

@mcollovati
Copy link
Copy Markdown
Collaborator

The dev server proxy in AbstractDevServerRunner forwarded all HTTP headers between the browser and the Vite dev server, including hop-by-hop headers that must not be forwarded by a proxy per RFC 9110 Section 7.6.1. It also forwarded the upstream Content-Length which may not match the actual bytes after HttpURLConnection decoding, causing broken responses on some servlet containers.

This change filters hop-by-hop headers and Content-Length from proxied requests and responses, and avoids closing the output stream after sendError().

Related to #23564

The dev server proxy in `AbstractDevServerRunner` forwarded all HTTP
headers between the browser and the Vite dev server, including
hop-by-hop headers that must not be forwarded by a proxy per RFC 9110
Section 7.6.1. It also forwarded the upstream Content-Length which may
not match the actual bytes after HttpURLConnection decoding, causing
broken responses on some servlet containers.

This change filters hop-by-hop headers and Content-Length from proxied
requests and responses, and avoids closing the output stream after
`sendError()`.

Related to #23564
@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

Test Results

1 318 files  ±0  1 318 suites  ±0   1h 20m 9s ⏱️ - 5m 55s
9 350 tests +3  9 282 ✅ +3  68 💤 ±0  0 ❌ ±0 
9 804 runs  +5  9 729 ✅ +6  75 💤  - 1  0 ❌ ±0 

Results for commit a35cdcd. ± Comparison against base commit a4ed2fe.

@caalador caalador merged commit 9f43ec4 into 25.0 Apr 10, 2026
30 checks passed
@caalador caalador deleted the cherry/cherrypick-24092-to-25.0 branch April 10, 2026 07:45
@vaadin-bot
Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 25.0.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants