From 37ee555c8e09f2b04603603f19f0658ca1baf390 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 20 Dec 2021 22:12:02 +0100 Subject: [PATCH] outposts/proxy: fix ping URI not being routed Signed-off-by: Jens Langhammer --- internal/outpost/proxyv2/handlers.go | 4 ++++ internal/outpost/proxyv2/proxyv2.go | 1 + 2 files changed, 5 insertions(+) diff --git a/internal/outpost/proxyv2/handlers.go b/internal/outpost/proxyv2/handlers.go index b011131c6..103d6cf6e 100644 --- a/internal/outpost/proxyv2/handlers.go +++ b/internal/outpost/proxyv2/handlers.go @@ -48,6 +48,10 @@ func (ps *ProxyServer) Handle(rw http.ResponseWriter, r *http.Request) { ps.HandleStatic(rw, r) return } + if strings.HasPrefix(r.URL.Path, "/akprox/ping") { + ps.HandlePing(rw, r) + return + } host := web.GetHost(r) a, ok := ps.apps[host] if !ok { diff --git a/internal/outpost/proxyv2/proxyv2.go b/internal/outpost/proxyv2/proxyv2.go index dbf481801..d6d44d530 100644 --- a/internal/outpost/proxyv2/proxyv2.go +++ b/internal/outpost/proxyv2/proxyv2.go @@ -66,6 +66,7 @@ func NewProxyServer(ac *ak.APIController, portOffset int) *ProxyServer { defaultCert: defaultCert, } globalMux.PathPrefix("/akprox/static").HandlerFunc(s.HandleStatic) + globalMux.Path("/akprox/ping").HandlerFunc(s.HandlePing) rootMux.PathPrefix("/").HandlerFunc(s.Handle) return s }