Enable using base URLs with path extensions#1225
Conversation
0e8c096 to
dc527e2
Compare
dc527e2 to
883d33e
Compare
883d33e to
f36249a
Compare
| let url = url_with_path_suffix( | ||
| ¤t, | ||
| &format!("{}/{}.{}/{}", self.prefix, self.pkg, service, method), | ||
| ); |
There was a problem hiding this comment.
🔍 Failover region URLs will not inherit the original base path
When a request fails over to a region URL, current is replaced by the URL returned from failover::pick_next (livekit-api/src/services/twirp_client.rs:289-290), which comes from the /settings/regions discovery response. These region URLs are bare host URLs (e.g. https://region1.livekit.cloud) without any path prefix. So url_with_path_suffix(¤t, ...) at livekit-api/src/services/twirp_client.rs:234-237 will only append the Twirp service path, without the original base URL's path extension. This is likely correct — region URLs point directly at LiveKit Cloud servers, not through the same reverse proxy — but it means the base-path feature only applies to the primary endpoint, not failover targets. Worth confirming this matches the intended behavior for users behind a path-based reverse proxy.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
I think this is fine because next comes from the server so it should hopefully already have any required path?
be660d9 to
104ac83
Compare
104ac83 to
c541f4b
Compare
c541f4b to
55bf571
Compare
Before you submit your PR
Make sure the following is true before submitting your PR:
PR description
The SDK currently replaces the entire path of the base URL when forming request URLs. This makes it impossible to use base URLs that already contain path extensions. This change simply appends the computed path to the base path instead of overwriting it which matches what the Go SDK does.
Breaking changes
None.
MSRV
Not applicable.
Testing
Unit tests added.
Async
Not applicable.