fix: SERVE_ROBOTS_TXT works again (#1229)
Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
parent
62c1b80189
commit
59f1e36167
7 changed files with 73 additions and 0 deletions
|
|
@ -345,6 +345,15 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
// Forward robots.txt requests to mux when ServeRobotsTXT is enabled
|
||||
if s.opts.ServeRobotsTXT {
|
||||
path := strings.TrimPrefix(r.URL.Path, anubis.BasePrefix)
|
||||
if path == "/robots.txt" || path == "/.well-known/robots.txt" {
|
||||
s.mux.ServeHTTP(w, r)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
s.maybeReverseProxyOrPage(w, r)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue