From 8821c8f959ca45a7e78b3750f8070bb727ef7005 Mon Sep 17 00:00:00 2001 From: Stavros Kontopoulos Date: Fri, 10 Jan 2025 13:21:29 +0200 Subject: [PATCH] Allow paths without leading slash in probes --- pkg/queue/health/probe.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/queue/health/probe.go b/pkg/queue/health/probe.go index 2aa0d6e27e4d..c688155899dc 100644 --- a/pkg/queue/health/probe.go +++ b/pkg/queue/health/probe.go @@ -24,6 +24,7 @@ import ( "net" "net/http" "net/url" + "strings" "syscall" "time" @@ -111,7 +112,7 @@ var transport = func() *http.Transport { }() func getURL(config HTTPProbeConfigOptions) (*url.URL, error) { - return url.Parse(string(config.Scheme) + "://" + net.JoinHostPort(config.Host, config.Port.String()) + config.Path) + return url.Parse(string(config.Scheme) + "://" + net.JoinHostPort(config.Host, config.Port.String()) + "/" + strings.TrimPrefix(config.Path, "/")) } // http2UpgradeProbe checks that an HTTP with HTTP2 upgrade request