feat: add HERO_PROXY_DEFAULT_SERVICE fallback for SPA routing #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_default_service"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When set, paths without a service prefix (e.g. /login) are forwarded to the named default service socket.
Closes #1
The previous commit restricted default service to only unprefixed paths, but extract_prefix("/login") returns Some(("login", "/")) — so paths like /login, /desktop were getting 404 instead of routing to hero_os_http. Restore original behavior: any path without a matching socket falls back to the default service (when configured). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>When a path has no matching service socket and a default service is configured, issue a 302 redirect to /{default_service}{path} instead of transparently proxying. This ensures the browser URL always starts with the service prefix (e.g. /hero_os_http/login instead of /login), which is required for Dioxus SPAs that use base_path routing. Without the correct URL prefix, Dioxus base_path causes double-prefix navigation (/hero_os_http/hero_os_http). An anti-loop guard prevents redirect when the prefix already matches the default service name (avoids infinite redirect if socket is gone). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>