From d70f4a66db784dc2676c9200c517a4bb1e9ada39 Mon Sep 17 00:00:00 2001 From: dylanyang Date: Mon, 4 Mar 2024 22:29:47 +0800 Subject: [PATCH] fix healty --- rpc_server/routers/method_map.go | 10 ++++++---- rpc_server/routers/routers_map.go | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/rpc_server/routers/method_map.go b/rpc_server/routers/method_map.go index 1a9b78cf..0a89d780 100644 --- a/rpc_server/routers/method_map.go +++ b/rpc_server/routers/method_map.go @@ -5,10 +5,12 @@ import "github.com/gin-gonic/gin" type RestfulMethod string const ( - PUT RestfulMethod = "PUT" - GET RestfulMethod = "GET" - DELETE RestfulMethod = "DELETE" - POST RestfulMethod = "POST" + PUT RestfulMethod = "PUT" + GET RestfulMethod = "GET" + DELETE RestfulMethod = "DELETE" + POST RestfulMethod = "POST" + HEAD RestfulMethod = "HEAD" + OPTIONS RestfulMethod = "OPTIONS" ) type RouterMap struct { diff --git a/rpc_server/routers/routers_map.go b/rpc_server/routers/routers_map.go index 08d02905..ec90f12b 100644 --- a/rpc_server/routers/routers_map.go +++ b/rpc_server/routers/routers_map.go @@ -15,7 +15,7 @@ func init() { PrivateRouterMaps = append(PrivateRouterMaps, RouterMap{string(GetSupportStrategy), []RestfulMethod{GET}, v1.GetSupportStrategy}) PrivateRouterMaps = append(PrivateRouterMaps, RouterMap{string(GetSupportEntrypoint), []RestfulMethod{GET}, v1.GetSupportEntrypoint}) PublicRouterMaps = append(PublicRouterMaps, RouterMap{string(Auth), []RestfulMethod{POST}, api.Auth}) - PublicRouterMaps = append(PublicRouterMaps, RouterMap{string(Healthz), []RestfulMethod{GET, POST, PUT, DELETE}, api.Healthz}) + PublicRouterMaps = append(PublicRouterMaps, RouterMap{string(Healthz), []RestfulMethod{GET, HEAD, OPTIONS}, api.Healthz}) } type Path string