@@ -577,13 +577,7 @@ func (p *OAuthProxy) serveHTTP(rw http.ResponseWriter, req *http.Request) {
577577
578578// RobotsTxt disallows scraping pages from the OAuthProxy
579579func (p *OAuthProxy) RobotsTxt(rw http.ResponseWriter, req *http.Request) {
580− _, err := fmt.Fprintf(rw, "User-agent: *\nDisallow: /")
581− if err != nil {
582− logger.Printf("Error writing robots.txt: %v", err)
583− p.ErrorPage(rw, req, http.StatusInternalServerError, err.Error())
584− return
585− }
586− rw.WriteHeader(http.StatusOK)
580+ p.pageWriter.WriteRobotsTxt(rw, req)
587581}
588582
589583// ErrorPage writes an error response