Repository navigation
fix(proxy): route the trailing-slash root of proxied subpaths (SHD-1087) - #34
Merged
Merged
Conversation
Signed-off-by: janosmurai <janos.murai@axem.dev>
janosmurai
force-pushed
the
SHD-1087/app-trailing-slash
branch
from
October 19, 2026 12:03
266c2fb to
5ff5b16
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change
Related issue
Closes SHD-1087
Description
With
WEBAPP_URLset,/app/returned the server's ownroute_not_found404, while/app,/app/index.htmland the assets were proxied correctly. The web app is built with base path/app/, so/app/is its canonical URL.ReverseProxymounts itself withRouter::nest(path, ...). In axum 0.8,nestmatchespathandpath/{*rest}, and a catch-all never matches an empty remainder, sopath/fell through tofallback_404./control-panel/had the same gap.The new
routes::proxy::subpath_proxymounts the proxy as before and also routespath/to it withroute_service. Both/appand/control-panelnow use it. The proxy strips its own base path, so/app/reaches the upstream as/, the same as/app.Validation
cargo fmt --checkcargo clippy --all-targets --all-features -- -D warningscargo build --verbose --all-featurescargo test --verbose --all-featuresAdditional validation details:
just check, which covers the four checks above.routes/proxy.rsrun the router against a real upstream server that echoes the path it received./app,/app/,/app/index.htmland/app/assets/index.js?v=1should reach the upstream as/,/,/index.htmland/assets/index.js?v=1./,/applicationand/v1/modelsshould not be proxied./app/route removed, the test fails at/app/with(404, ""), which reproduces the bug.Deployment and compatibility
None. No configuration or API changes.
/app/and/control-panel/now reach their upstream instead of returning 404.Documentation
None needed. This makes the documented
/appproxy behave as expected.Checklist
Signed-off-bytrailer (git commit -s).AI assistance: