ApplyAppearance: keep a path StripPrefix already made relative

Behind http.StripPrefix the request path is relative to the base path,
so for base path /feeds the page /feeds was cut to / again. A path that
no longer matches RequestURI's is now taken as already stripped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
terminarandClaude Opus 5.5 committed 2026-10-31 23:32:24 +01:00
1 parent 0f9b40df9f
commit 28db4f707f
3 files changed
+51 -6

No files matched your search

+5 -1
View File
@@ -98,7 +98,11 @@ the cookies `yw_theme`/`yw_palette` (path `BasePath/`, a year,
`HttpOnly`, `SameSite=Lax`) and redirects to `back`, but only to a path
inside the UI. Any other method gets 405. `ApplyAppearance` ignores
unknown cookie values, so whatever the consumer set before stays the
default. A consumer whose middleware wants a CSRF token on every POST
default. It works with and without `http.StripPrefix` in front of the
UI: a path that differs from the request's `RequestURI` is taken as
already relative and kept as it is (v0.3.1; up to v0.3.0 the page
`/feeds` behind StripPrefix with base path `/feeds` was wrongly cut to
`/`). A consumer whose middleware wants a CSRF token on every POST
puts the hidden field into `AppearanceFormHTML`, which is rendered
inside the menu's form. A consumer with its own switch can keep it and
just set `Theme`/`Palette` (none does today).