Commit 5167096
committed
fix REST OpenAPI redirect to include mount path
PR #579 fixed a path-absolute redirect bug but introduced a new issue:
the redirect target was missing the /rest mount path, producing
https://transit.land/api/v2/openapi.json instead of
https://transit.land/api/v2/rest/openapi.json.
Root cause: chi v5 does not strip r.URL.Path — it only updates
rctx.RoutePath internally. So r.URL.Path in the handler still contains
the full path (/rest/), the same value the pagination code already
relies on when constructing `meta["next"]` links.
Fix: combine cfg.RestPrefix (for the absolute base) with r.URL.Path
(for the mount path) to produce a correct absolute redirect URL.1 parent acbd2cb commit 5167096
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
| |||
0 commit comments