Skip to content

Commit

Permalink
Merge pull request #141 from masnax/proxy-url
Browse files Browse the repository at this point in the history
microcloud/api/services/proxy: Don't use whole path for request URL
  • Loading branch information
masnax authored Jul 20, 2023
2 parents bbbb812 + 9a31c8c commit 091ee78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions microcloud/api/services_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 091ee78

Please sign in to comment.