fix: enable double slashes for optional path variables

Closes #754

This implementation is flawed, it's making the pass-challenge route
return 404s. I'm not entirely sure why this is happening, but I'm
pushing this for now in case there's some low hanging fruit.

Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
Xe Iaso
2025-07-11 01:19:57 +00:00
parent c74de19532
commit 9a00809840
9 changed files with 37 additions and 19 deletions

View File

@@ -10,6 +10,7 @@ import (
"github.com/TecharoHQ/anubis"
"github.com/TecharoHQ/anubis/internal"
"github.com/gorilla/mux"
)
var (
@@ -20,8 +21,6 @@ var (
)
func init() {
Mount(http.DefaultServeMux)
//goland:noinspection GoBoolExpressions
if anubis.Version != "devel" {
URL = filepath.Join(filepath.Dir(URL), "xess.min.css")
@@ -31,8 +30,10 @@ func init() {
}
// Mount registers the xess static file handlers on the given mux
func Mount(mux *http.ServeMux) {
func Mount(r *mux.Router) {
prefix := anubis.BasePrefix + "/.within.website/x/xess/"
mux.Handle(prefix, internal.UnchangingCache(http.StripPrefix(prefix, http.FileServerFS(Static))))
r.PathPrefix(prefix).
Handler(internal.UnchangingCache(http.StripPrefix(prefix, http.FileServerFS(Static)))).
Name("xess")
}