From 9a31c8cab564c751f8ff2b4311198ff6deefffa1 Mon Sep 17 00:00:00 2001 From: Max Asnaashari Date: Thu, 20 Jul 2023 12:11:18 +0000 Subject: [PATCH] microcloud/api/services/proxy: Don't use whole path for request URL Signed-off-by: Max Asnaashari --- microcloud/api/services_proxy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/microcloud/api/services_proxy.go b/microcloud/api/services_proxy.go index d24febabe..d2558636e 100644 --- a/microcloud/api/services_proxy.go +++ b/microcloud/api/services_proxy.go @@ -94,7 +94,7 @@ func lxdHandler(s *state.State, r *http.Request) response.Response { r.RequestURI = "" r.URL.Path = path r.URL.Scheme = "http" - r.URL.Host = filepath.Join(LXDDir, "unix.socket") + r.URL.Host = "unix.socket" r.Host = r.URL.Host client, err := lxd.ConnectLXDUnix(filepath.Join(LXDDir, "unix.socket"), nil) if err != nil { @@ -121,7 +121,7 @@ func microHandler(service string, stateDir string) func(*state.State, *http.Requ r.RequestURI = "" r.URL.Path = path r.URL.Scheme = "http" - r.URL.Host = filepath.Join(stateDir, "control.socket") + r.URL.Host = "control.socket" r.Host = r.URL.Host client, err := microcluster.App(s.Context, microcluster.Args{StateDir: stateDir}) if err != nil {