mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
adds handling robot.txt rout #154
This commit is contained in:
parent
8ee6561910
commit
d98a110aef
1 changed files with 6 additions and 0 deletions
|
|
@ -850,6 +850,12 @@ func (s *Server) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
if r.URL.Path == "/robot.txt" {
|
||||
w.Header().Set("Last-Modified", time.Now().Format(http.TimeFormat))
|
||||
fmt.Fprintf(w, "User-agent: *\nDisallow: /")
|
||||
return
|
||||
}
|
||||
|
||||
uri, err := api.Parse(strings.TrimLeft(r.URL.Path, "/"))
|
||||
if err != nil {
|
||||
Respond(w, req, fmt.Sprintf("invalid URI %q", r.URL.Path), http.StatusBadRequest)
|
||||
|
|
|
|||
Loading…
Reference in a new issue