outposts/proxy: fix ping URI not being routed

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-12-20 22:12:02 +01:00
parent f910da0f8a
commit 37ee555c8e
2 changed files with 5 additions and 0 deletions

View File

@ -48,6 +48,10 @@ func (ps *ProxyServer) Handle(rw http.ResponseWriter, r *http.Request) {
ps.HandleStatic(rw, r) ps.HandleStatic(rw, r)
return return
} }
if strings.HasPrefix(r.URL.Path, "/akprox/ping") {
ps.HandlePing(rw, r)
return
}
host := web.GetHost(r) host := web.GetHost(r)
a, ok := ps.apps[host] a, ok := ps.apps[host]
if !ok { if !ok {

View File

@ -66,6 +66,7 @@ func NewProxyServer(ac *ak.APIController, portOffset int) *ProxyServer {
defaultCert: defaultCert, defaultCert: defaultCert,
} }
globalMux.PathPrefix("/akprox/static").HandlerFunc(s.HandleStatic) globalMux.PathPrefix("/akprox/static").HandlerFunc(s.HandleStatic)
globalMux.Path("/akprox/ping").HandlerFunc(s.HandlePing)
rootMux.PathPrefix("/").HandlerFunc(s.Handle) rootMux.PathPrefix("/").HandlerFunc(s.Handle)
return s return s
} }