diff options
| -rw-r--r-- | internal/configuration/schema/types_address.go | 8 | ||||
| -rw-r--r-- | internal/configuration/schema/types_address_test.go | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/internal/configuration/schema/types_address.go b/internal/configuration/schema/types_address.go index 37bd8d7d8..012cc72ba 100644 --- a/internal/configuration/schema/types_address.go +++ b/internal/configuration/schema/types_address.go @@ -389,8 +389,12 @@ func (a *Address) RouterPath() string { return "" } - if a.url.Query().Has("path") { - return fmt.Sprintf("/%s", a.url.Query().Get("path")) + if a.socket { + if a.url.Query().Has("path") { + return fmt.Sprintf("/%s", a.url.Query().Get("path")) + } + + return "/" } return a.url.Path diff --git a/internal/configuration/schema/types_address_test.go b/internal/configuration/schema/types_address_test.go index a5baee7be..f4408757e 100644 --- a/internal/configuration/schema/types_address_test.go +++ b/internal/configuration/schema/types_address_test.go @@ -634,7 +634,7 @@ func TestAddress_UnixDomainSocket(t *testing.T) { fmt.Sprintf("unix://%s", filepath.Join(dir, "example.sock")), true, filepath.Join(dir, "example.sock"), - filepath.Join(dir, "example.sock"), + "/", "", -1, "", @@ -644,7 +644,7 @@ func TestAddress_UnixDomainSocket(t *testing.T) { fmt.Sprintf("unix://%s?umask=0022", filepath.Join(dir, "example.sock")), true, filepath.Join(dir, "example.sock"), - filepath.Join(dir, "example.sock"), + "/", "0022", 18, "", |
