mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-15 21:04:56 +00:00
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:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user