From a3bdc22234b75e9420f8810918072fa34732ffb7 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Fri, 10 Apr 2020 17:31:38 -0600 Subject: admin: Always enforce Host header checks With a simple heuristic for loopback addresses, we can enable this by default without adding unnecessary inconvenience. --- listeners_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'listeners_test.go') diff --git a/listeners_test.go b/listeners_test.go index 2828a3b..b75e2dc 100644 --- a/listeners_test.go +++ b/listeners_test.go @@ -138,6 +138,14 @@ func TestJoinNetworkAddress(t *testing.T) { network: "unix", host: "/foo/bar", port: "", expect: "unix//foo/bar", }, + { + network: "unix", host: "/foo/bar", port: "0", + expect: "unix//foo/bar", + }, + { + network: "unix", host: "/foo/bar", port: "1234", + expect: "unix//foo/bar", + }, { network: "", host: "::1", port: "1234", expect: "[::1]:1234", -- cgit v1.2.3