missing limiter on robots

This commit is contained in:
Umputun
2018-06-01 13:11:29 -05:00
parent aa997d5ca0
commit e4176e2afd
+4 -3
View File
@@ -165,9 +165,10 @@ func (s *Rest) routes() chi.Router {
})
})
router.Get("/robots.txt", func(w http.ResponseWriter, r *http.Request) {
render.PlainText(w, r, "User-agent: *\nDisallow: /auth/\nDisallow: /api/\n")
})
router.With(tollbooth_chi.LimitHandler(tollbooth.NewLimiter(10, nil))).
Get("/robots.txt", func(w http.ResponseWriter, r *http.Request) {
render.PlainText(w, r, "User-agent: *\nDisallow: /auth/\nDisallow: /api/\n")
})
// file server for static content from /web
addFileServer(router, "/web", http.Dir(s.WebRoot))