From 6dff731ae62f247638972cce0caea3f6146fece6 Mon Sep 17 00:00:00 2001 From: Paschalis Tsilias Date: Tue, 20 Aug 2024 17:37:32 +0300 Subject: [PATCH] http: fix pathPrefix used to look up remotecfg's components (#1501) Signed-off-by: Paschalis Tsilias --- internal/service/http/http.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/service/http/http.go b/internal/service/http/http.go index 9e3abfb183..ff070b330b 100644 --- a/internal/service/http/http.go +++ b/internal/service/http/http.go @@ -178,8 +178,9 @@ func (s *Service) Run(ctx context.Context, host service.Host) error { } // NOTE(@tpaschalis) These need to be kept in order for the longer - // remotecfg prefix to be invoked correctly. - r.PathPrefix(s.componentHttpPathPrefixRemotecfg).Handler(s.componentHandler(remoteCfgHostProvider(host), s.componentHttpPathPrefixRemotecfg)) + // remotecfg prefix to be invoked correctly. The pathPrefix is still the + // same so that `remotecfg/` is not stripped from component lookups. + r.PathPrefix(s.componentHttpPathPrefixRemotecfg).Handler(s.componentHandler(remoteCfgHostProvider(host), s.componentHttpPathPrefix)) r.PathPrefix(s.componentHttpPathPrefix).Handler(s.componentHandler(rootHostProvider(host), s.componentHttpPathPrefix)) if s.opts.ReadyFunc != nil {