diff --git a/public-report/endpoint.go b/public-report/endpoint.go index 58cfab0f..206778f9 100644 --- a/public-report/endpoint.go +++ b/public-report/endpoint.go @@ -1,6 +1,7 @@ package publicreport import ( + "fmt" "net/http" "github.com/Gleipnir-Technology/nidus-sync/htmlpage" @@ -25,6 +26,11 @@ func getRoot(w http.ResponseWriter, r *http.Request) { ) } +func getRobots(w http.ResponseWriter, r *http.Request) { + fmt.Fprint(w, "User-agent: *\n") + fmt.Fprint(w, "Allow: /\n") +} + // Respond with an error that is visible to the user func respondError(w http.ResponseWriter, m string, e error, s int) { log.Warn().Int("status", s).Err(e).Str("user message", m).Msg("Responding with an error") diff --git a/public-report/routes.go b/public-report/routes.go index dcd26315..9f5487e7 100644 --- a/public-report/routes.go +++ b/public-report/routes.go @@ -8,6 +8,7 @@ import ( func Router() chi.Router { r := chi.NewRouter() r.Get("/", getRoot) + r.Get("/robots.txt", getRobots) r.Get("/email/report/{report_id}/subscription-confirmation", getEmailReportSubscriptionConfirmation) r.Get("/nuisance", getNuisance) r.Post("/nuisance-submit", postNuisance)