diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go index 9248fc6..17d84fa 100644 --- a/internal/handlers/handlers.go +++ b/internal/handlers/handlers.go @@ -37,11 +37,6 @@ func (FilesHandlers) AssetsFS() http.FileSystem { return web.Assets() } -func (FilesHandlers) Robots(w http.ResponseWriter, r *http.Request) { - fc, _ := web.AssetsGetFile("robots.txt") - w.Write(fc) -} - func (h *FilesHandlers) Index(w http.ResponseWriter, r *http.Request) { path := httprouter.CleanPath(server.GetURLParam(r, "filepath")) @@ -50,6 +45,12 @@ func (h *FilesHandlers) Index(w http.ResponseWriter, r *http.Request) { return } + if strings.HasPrefix(path, "/robots.txt") { + fc, _ := web.AssetsGetFile("robots.txt") + w.Write(fc) + return + } + if strings.HasPrefix(path, "/file") { if h.noFileHandling { w.WriteHeader(http.StatusServiceUnavailable)