Moved robots.txt handling to Index().
This commit is contained in:
parent
b793da40d4
commit
007ab59c81
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user