From 9d598836c307bfd4bcf7ba69c7e64e0b0667570b Mon Sep 17 00:00:00 2001 From: Ben Toogood Date: Tue, 7 Apr 2020 11:37:04 +0100 Subject: [PATCH] Fix Tests --- api/server/auth/auth_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/server/auth/auth_test.go b/api/server/auth/auth_test.go index 04923e35..7fd09581 100644 --- a/api/server/auth/auth_test.go +++ b/api/server/auth/auth_test.go @@ -2,6 +2,7 @@ package auth import ( "net/http" + "net/url" "testing" "github.com/micro/go-micro/v2/auth" @@ -28,7 +29,7 @@ func TestNamespaceFromRequest(t *testing.T) { for _, tc := range tt { t.Run(tc.Host, func(t *testing.T) { - ns := h.NamespaceFromRequest(&http.Request{Host: tc.Host}) + ns := h.NamespaceFromRequest(&http.Request{Host: tc.Host, URL: &url.URL{Host: tc.Host}}) if ns != tc.Namespace { t.Errorf("Expected namespace %v for host %v, actually got %v", tc.Namespace, tc.Host, ns) }