From f60e1a1af25154160f08b85eb159c930b340df8b Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Fri, 19 Apr 2024 21:43:56 +0800 Subject: [PATCH] Fix HEAD method for robots.txt (#30603) Fix #30601 --- routers/web/web.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/web/web.go b/routers/web/web.go index a6a4c1d98..8fa24a282 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -258,7 +258,7 @@ func Routes() *web.Route { routes.Get("/metrics", append(mid, Metrics)...) } - routes.Get("/robots.txt", append(mid, misc.RobotsTxt)...) + routes.Methods("GET,HEAD", "/robots.txt", append(mid, misc.RobotsTxt)...) routes.Get("/ssh_info", misc.SSHInfo) routes.Get("/api/healthz", healthcheck.Check)