@@ -17,7 +17,6 @@ import (
1717
1818 v1 "k8s.io/api/core/v1"
1919
20- "github.com/go-chi/chi/v5"
2120 "github.com/nginxinc/kubernetes-ingress/internal/configs"
2221 "github.com/nginxinc/nginx-plus-go-client/client"
2322 "k8s.io/utils/strings/slices"
@@ -80,9 +79,9 @@ func NewHealthServer(addr string, nc *client.NginxClient, cnf *configs.Configura
8079
8180// ListenAndServe starts healthcheck server.
8281func (hs * HealthServer ) ListenAndServe () error {
83- mux := chi . NewRouter ()
84- mux .Get ( " /probe/{hostname}" , hs .UpstreamStats )
85- mux .Get ( " /probe/ts/{name}" , hs .StreamStats )
82+ mux := http . NewServeMux ()
83+ mux .HandleFunc ( "GET /probe/{hostname}" , hs .UpstreamStats )
84+ mux .HandleFunc ( "GET /probe/ts/{name}" , hs .StreamStats )
8685 hs .Server .Handler = mux
8786 if hs .Server .TLSConfig != nil {
8887 return hs .Server .ListenAndServeTLS ("" , "" )
@@ -97,7 +96,7 @@ func (hs *HealthServer) Shutdown(ctx context.Context) error {
9796
9897// UpstreamStats calculates health stats for the host identified by the hostname in the request URL.
9998func (hs * HealthServer ) UpstreamStats (w http.ResponseWriter , r * http.Request ) {
100- hostname := chi . URLParam ( r , "hostname" )
99+ hostname := r . PathValue ( "hostname" )
101100 host := sanitize (hostname )
102101
103102 upstreamNames := hs .UpstreamsForHost (host )
@@ -137,7 +136,7 @@ func (hs *HealthServer) UpstreamStats(w http.ResponseWriter, r *http.Request) {
137136// StreamStats calculates health stats for the TransportServer(s)
138137// identified by the service (action) name in the request URL.
139138func (hs * HealthServer ) StreamStats (w http.ResponseWriter , r * http.Request ) {
140- name := chi . URLParam ( r , "name" )
139+ name := r . PathValue ( "name" )
141140 n := sanitize (name )
142141 streamUpstreamNames := hs .StreamUpstreamsForName (n )
143142 if len (streamUpstreamNames ) == 0 {
0 commit comments