From caf7472f6a1f66c2b3a0e51668868e1d644eb0f4 Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Mon, 6 Nov 2023 15:45:30 -0600 Subject: [PATCH] only support unix --- config/confighttp/confighttp.go | 7 ++----- config/confighttp/confighttp_test.go | 24 ------------------------ 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/config/confighttp/confighttp.go b/config/confighttp/confighttp.go index 3afce8a1689..f5a12a68d8d 100644 --- a/config/confighttp/confighttp.go +++ b/config/confighttp/confighttp.go @@ -220,7 +220,7 @@ type HTTPServerSettings struct { Endpoint string `mapstructure:"endpoint"` // Network configures the network associated with the server. - // The network must be "tcp", "tcp4", "tcp6", "unix" or "unixpacket". + // The network must be "tcp", "tcp4", "tcp6" or "unix". Network string `mapstructure:"network"` // TLSSetting struct exposes TLS client configuration. @@ -250,9 +250,6 @@ func (hss *HTTPServerSettings) ToListener() (net.Listener, error) { if network == "" { network = "tcp" } - if network == "http+unix" || network == "https+unix" || network == "unixpacket" { - network = "unix" - } listener, err := net.Listen(network, hss.Endpoint) if err != nil { return nil, err @@ -272,7 +269,7 @@ func (hss *HTTPServerSettings) ToListener() (net.Listener, error) { func (hss *HTTPServerSettings) Validate() error { switch hss.Network { - case "tcp", "tcp4", "tcp6", "unix", "unixpacket", "http+unix", "https+unix", "": + case "tcp", "tcp4", "tcp6", "unix", "": default: return fmt.Errorf("invalid network %q", hss.Network) } diff --git a/config/confighttp/confighttp_test.go b/config/confighttp/confighttp_test.go index 83fd399c3ab..c6aac9a9455 100644 --- a/config/confighttp/confighttp_test.go +++ b/config/confighttp/confighttp_test.go @@ -1386,30 +1386,6 @@ func TestHTTPServerSettings_Validate(t *testing.T) { }, nil, }, - { - "unixpacket", - &HTTPServerSettings{ - Network: "unixpacket", - Endpoint: unixSocket, - }, - nil, - }, - { - "http+unix", - &HTTPServerSettings{ - Network: "http+unix", - Endpoint: unixSocket, - }, - nil, - }, - { - "https+unix", - &HTTPServerSettings{ - Network: "https+unix", - Endpoint: unixSocket, - }, - nil, - }, { "invalid", &HTTPServerSettings{