Skip to content

ref(upstream): Forward envelopes to the advertised upstream#5844

Open
Dav1dde wants to merge 2 commits intomasterfrom
dav1d/use-advertised-upstream
Open

ref(upstream): Forward envelopes to the advertised upstream#5844
Dav1dde wants to merge 2 commits intomasterfrom
dav1d/use-advertised-upstream

Conversation

@Dav1dde
Copy link
Copy Markdown
Member

@Dav1dde Dav1dde commented Apr 16, 2026

Implements forwarding of envelopes to the advertised upstream of an upstream Relay.

This adds some integration test machinery to allow observing http requests (mini_proxy).

@Dav1dde Dav1dde self-assigned this Apr 16, 2026
@Dav1dde Dav1dde force-pushed the dav1d/upstream-desc-arc-str branch from d3bfdea to 4ee2238 Compare April 17, 2026 08:34
Base automatically changed from dav1d/upstream-desc-arc-str to master April 20, 2026 06:07
@Dav1dde Dav1dde force-pushed the dav1d/use-advertised-upstream branch from 2817666 to 65b2f59 Compare April 28, 2026 13:16
@Dav1dde Dav1dde force-pushed the dav1d/use-advertised-upstream branch from 65b2f59 to a19b2de Compare May 4, 2026 14:22
@Dav1dde Dav1dde marked this pull request as ready for review May 4, 2026 14:22
@Dav1dde Dav1dde requested a review from a team as a code owner May 4, 2026 14:22
Comment thread relay-server/src/services/upstream.rs
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a19b2de. Configure here.

let url = request
.upstream()
.unwrap_or_else(|| self.config.upstream())
.get_url(request.path().as_ref());
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Host header not updated for overridden upstream

High Severity

When a request provides an upstream override, the URL is correctly resolved from the overridden UpstreamDescriptor, but the Host header fallback still always uses self.config.upstream().host(). This means requests routed to a different upstream will carry the wrong Host header, which can cause routing failures at the target server in production where hosts differ. The fallback in host_header needs to also consider request.upstream().

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a19b2de. Configure here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as on the Sentry one: I actually kept this for now on purpose, didn't see a reason to override it.

Copy link
Copy Markdown
Contributor

@loewenheim loewenheim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is without having read the proxy testing logic in detail.

Comment thread relay-server/src/services/processor.rs Outdated
Co-authored-by: Sebastian Zivota <loewenheim@users.noreply.github.com>
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.

2 participants