From 79484e1cb7bcfbd677c6e4f19ed8012d372e7366 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Fri, 19 Apr 2024 22:43:50 +0800 Subject: [PATCH] Fix HEAD method for robots.txt (#30603) (#30604) Backport #30603 by wxiaoguang 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 d3749b7d29..1e423712c4 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -261,7 +261,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)