core/validatorapi: fix SSE proxying#4495
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes SSE reverse-proxying in core/validatorapi that was causing validator clients to receive 502s by correcting httputil.ReverseProxy configuration for streaming requests.
Changes:
- Clear
ReverseProxy.Directorbefore settingReverseProxy.Rewriteto avoidServeHTTPrejecting the proxy configuration. - Use
ProxyRequest.SetURL(targetURL)in the rewrite function to correctly apply the upstream target URL for SSE requests. - Add an internal test that spins up an upstream SSE server and verifies the
/eth/v1/eventsstream is proxied end-to-end.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| core/validatorapi/router.go | Fixes SSE reverse proxy setup by switching cleanly to Rewrite mode and applying SetURL for correct upstream targeting. |
| core/validatorapi/router_internal_test.go | Adds an end-to-end SSE proxy test to ensure streaming responses work and don’t regress. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4495 +/- ##
==========================================
+ Coverage 56.56% 57.09% +0.52%
==========================================
Files 245 245
Lines 32817 32826 +9
==========================================
+ Hits 18564 18741 +177
+ Misses 11895 11721 -174
- Partials 2358 2364 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|



VC was receiving 502s on SSE
category: bug
ticket: none