diff --git a/cmd/dwelling-radio/main.go b/cmd/dwelling-radio/main.go index e7e3652..4055618 100644 --- a/cmd/dwelling-radio/main.go +++ b/cmd/dwelling-radio/main.go @@ -64,7 +64,7 @@ func main() { srv.GET("/playlist", hand.Playlist) srv.GET("/filelist", hand.Filelist) - srv.GET("/robots.txt", hand.RobotsTxt) + srv.GET("/robots.txt", http.RobotsTxt) srv.GET("/favicon.svg", http.Favicon) if !*noLiquidsoap { diff --git a/internal/http/handlers.go b/internal/http/handlers.go index fca3332..9bec6d9 100644 --- a/internal/http/handlers.go +++ b/internal/http/handlers.go @@ -105,7 +105,7 @@ func (h *Handlers) Filelist(w http.ResponseWriter, _ *http.Request) { w.Write(data) } -func (h *Handlers) RobotsTxt(w http.ResponseWriter, _ *http.Request) { +func RobotsTxt(w http.ResponseWriter, _ *http.Request) { w.Header().Add("Content-Disposition", "attachment; filename=\"robots.txt\"") w.Write([]byte("User-agent: *\nDisallow: /assets/\nDisallow: /live/")) }