From 3330b4d5d816a49e38fe5c3a19450a9684667ec4 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 (cherry picked from commit f60e1a1af25154160f08b85eb159c930b340df8b) --- 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 71d5efef2c..154e1ce24b 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)