fix(router): accept trailing slash on iframe service paths #80

Merged
zaelgohary merged 1 commit from development_fix_router_trailing_slash into development 2026-04-30 11:32:05 +00:00
Member

Summary

Iframe-served services were 404ing on cold loads because hero_router redirected /<svc>/<webname>/ to /<svc>/<webname> (no trailing slash). Browsers then resolved <script src="./app.js"> against the slashless URL — landing on /<svc>/app.js instead of /<svc>/<webname>/app.js — and got 404.

Closes #79

Changes

  • Drop the trailing-slash 301 redirect fallback (added in b4d1aa3).
  • Register /:service_name/:webname/ as an alias of /:service_name/:webname.

Test Results

cargo check + cargo fmt + cargo test all pass. Smoke: /hero_voice/ui/ now returns 200, /hero_voice/ui/app.js loads.

## Summary Iframe-served services were 404ing on cold loads because hero_router redirected `/<svc>/<webname>/` to `/<svc>/<webname>` (no trailing slash). Browsers then resolved `<script src="./app.js">` against the slashless URL — landing on `/<svc>/app.js` instead of `/<svc>/<webname>/app.js` — and got 404. ## Related Issue Closes #79 ## Changes - Drop the trailing-slash 301 redirect fallback (added in b4d1aa3). - Register `/:service_name/:webname/` as an alias of `/:service_name/:webname`. ## Test Results cargo check + cargo fmt + cargo test all pass. Smoke: /hero_voice/ui/ now returns 200, /hero_voice/ui/app.js loads.
fix(router): accept trailing slash on iframe service paths
All checks were successful
Build & Test / check (pull_request) Successful in 2m26s
e3135bf9cc
Closes #79
zaelgohary force-pushed development_fix_router_trailing_slash from e3135bf9cc
All checks were successful
Build & Test / check (pull_request) Successful in 2m26s
to 5539f5fbed
All checks were successful
Build & Test / check (pull_request) Successful in 1m54s
2026-04-30 11:28:21 +00:00
Compare
zaelgohary merged commit b4e9d5c2e1 into development 2026-04-30 11:32:05 +00:00
zaelgohary deleted branch development_fix_router_trailing_slash 2026-04-30 11:32:06 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_router!80
No description provided.