From e0ca1bde9435ade640a12ca93965e88866c3b856 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Mon, 13 Jul 2026 21:29:18 -0700 Subject: Handle routing errors in a more sensible way --- roseh.moe.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/roseh.moe.go b/roseh.moe.go index f71761c..20c2101 100644 --- a/roseh.moe.go +++ b/roseh.moe.go @@ -855,8 +855,10 @@ func main() { mux.Handle("GET /code/", http.StripPrefix("/code/", http.FileServer(http.Dir(*codeDir)))) mux.HandleFunc("GET /static/", static) mux.HandleFunc("GET /favicon.ico", favicon) - mux.HandleFunc("PUT /api/wormhole/{name}", wormholeAPIUpload) - mux.HandleFunc("GET /", notFound) + apiMux := http.NewServeMux() + apiMux.HandleFunc("PUT /api/wormhole/{name}", wormholeAPIUpload) + mux.Handle("/api/", apiMux) + mux.HandleFunc("/", notFound) http.Handle("/", http.NewCrossOriginProtection().Handler(mux)) jellyfinURL, err := url.Parse("http://127.0.0.1:8096") if err != nil { -- cgit v1.3.1