netutil: allow using * to match any hostname (#7111)

This commit is contained in:
Joe Chen
2022-07-25 21:38:15 +08:00
committed by GitHub
parent 780b33c639
commit db82024fc7
4 changed files with 5 additions and 1 deletions

View File

@@ -31,6 +31,8 @@ func TestIsLocalHostname(t *testing.T) {
{hostname: "192.168.123.45", allowlist: []string{"10.0.0.17"}, want: true}, // #11
{hostname: "gogs.local", allowlist: []string{"gogs.local"}, want: false}, // #12
{hostname: "192.168.123.45", allowlist: []string{"*"}, want: false}, // #13
}
for _, test := range tests {
t.Run("", func(t *testing.T) {