ui: serve /robots.txt when UI is enabled. (#5089)

* serve /robots.txt
* robots.txt: disallow everything
This commit is contained in:
Hans Hasselberg 2018-12-17 19:35:03 +01:00 committed by GitHub
parent 787f3f8aa6
commit 0b4a879203
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -219,6 +219,7 @@ func (s *HTTPServer) handler(enableDebug bool) http.Handler {
uifs = &redirectFS{fs: uifs} uifs = &redirectFS{fs: uifs}
} }
mux.Handle("/robots.txt", http.FileServer(uifs))
mux.Handle("/ui/", http.StripPrefix("/ui/", http.FileServer(uifs))) mux.Handle("/ui/", http.StripPrefix("/ui/", http.FileServer(uifs)))
} }

View File

@ -1,3 +1,3 @@
# http://www.robotstxt.org # http://www.robotstxt.org
User-agent: * User-agent: *
Disallow: Disallow: *