outposts/proxy: fix path prefix in static handler

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-12-02 19:21:40 +01:00
parent b77b4b5c80
commit ea097afeae
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ func (ps *ProxyServer) HandlePing(rw http.ResponseWriter, r *http.Request) {
func (ps *ProxyServer) HandleStatic(rw http.ResponseWriter, r *http.Request) { func (ps *ProxyServer) HandleStatic(rw http.ResponseWriter, r *http.Request) {
staticFs := http.FileServer(http.Dir("./web/dist/")) staticFs := http.FileServer(http.Dir("./web/dist/"))
before := time.Now() before := time.Now()
web.DisableIndex(http.StripPrefix("/akprox/static", staticFs)).ServeHTTP(rw, r) web.DisableIndex(http.StripPrefix("/akprox/static/dist", staticFs)).ServeHTTP(rw, r)
after := time.Since(before) after := time.Since(before)
metrics.Requests.With(prometheus.Labels{ metrics.Requests.With(prometheus.Labels{
"outpost_name": ps.akAPI.Outpost.Name, "outpost_name": ps.akAPI.Outpost.Name,