You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AdkWebServer's root->dev-ui redirect breaks behind a path-stripping reverse proxy #1457
When this app is deployed behind a reverse proxy that strips a path prefix before forwarding the request (a common pattern for platform-managed multi-tenant gateways, e.g. Kubernetes Gateway API HTTPRoute with a URLRewrite/ReplacePrefixMatch filter), the browser follows this redirect to an unprefixed path the proxy has no route for, and the dev UI 404s.
Why this can't be fixed by the app alone with standard Spring mechanisms
Spring's own reverse-proxy support (server.forward-headers-strategy=framework, which installs ForwardedHeaderFilter) is specifically designed to solve exactly this class of problem via the X-Forwarded-Prefix header — but it only works for context-relative redirect targets (ones that do not start with /). I traced this through ForwardedHeaderExtractingResponse#sendRedirect:
Root-relative targets (starting with /, as "/dev-ui" does) skip the applyRelativePath branch entirely — the one place X-Forwarded-Prefix awareness would apply — so the prefix is never spliced back in, no matter how the proxy is configured.
Proposed fix
Change the redirect target to be context-relative instead of root-relative:
I verified this doesn't change behavior for the common local/non-proxied case: RedirectView's contextRelative handling only prepends the context path when the target starts with / (so a context-relative target like "dev-ui" is passed through as-is), and the servlet container's own relative-URL resolution for sendRedirect still resolves "dev-ui" against the current request path "/" to "/dev-ui". It does additionally allow server.forward-headers-strategy=framework + an X-Forwarded-Prefix header to correctly restore a proxy's path prefix, fixing the reverse-proxy case with zero app-specific workaround code.
I've opened a PR with this one-line fix plus the corresponding test update: (link to follow)
Environment
adk-java: current main (verified against commit e8b1c20)
Encountered while deploying a Java ADK agent behind a Kubernetes Gateway API HTTPRoute that strips a per-app path prefix
Hi @luisSilva1234, Thank you for reporting this issue. we appreciate you taking the time to submit the PR. Both the issue and the PR are currently under review by our team and we will keep you updated if any additional information is required. Thank you.
Activity
hemasekhar-p commentedon Aug 26, 2026
Hi @luisSilva1234, Thank you for reporting this issue. we appreciate you taking the time to submit the PR. Both the issue and the PR are currently under review by our team and we will keep you updated if any additional information is required. Thank you.
luissilva-mollie commentedon Aug 27, 2026
Hi @hemasekhar-p , had to open another MR because of the CLA verification. It should be all good now