handlers: a directory under /s/ answers 404, not a listing (closes #286)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
http.FileServer answered /s/ and /s/css/ with an HTML listing of the embedded files, and /s/css with a redirect to that listing. HandleStatic in internal/handlers now looks the name up in the embedded files first and answers 404 when it names a directory; files are served as before. The routes mount it under /s. Model: opus-5-5
This commit was merged in pull request #293.
This commit is contained in:
@@ -8,8 +8,6 @@ import (
|
||||
"github.com/go-chi/chi/v5"
|
||||
chimw "github.com/go-chi/chi/v5/middleware"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
|
||||
"sneak.berlin/go/dnswatcher/static"
|
||||
)
|
||||
|
||||
// requestTimeout is the maximum duration for handling a request.
|
||||
@@ -47,13 +45,7 @@ func (s *Server) SetupRoutes() {
|
||||
public.Get("/", s.handlers.HandleDashboard())
|
||||
|
||||
// Static assets (embedded CSS/JS)
|
||||
public.Mount(
|
||||
"/s",
|
||||
http.StripPrefix(
|
||||
"/s",
|
||||
http.FileServer(http.FS(static.Static)),
|
||||
),
|
||||
)
|
||||
public.Mount("/s", http.StripPrefix("/s", s.handlers.HandleStatic()))
|
||||
|
||||
// Health check (standard well-known path)
|
||||
public.Get(
|
||||
|
||||
Reference in New Issue
Block a user