diff --git a/pkg/authorization/api_test.go b/pkg/authorization/api_test.go index 9d51e9e66e..617fd69a17 100644 --- a/pkg/authorization/api_test.go +++ b/pkg/authorization/api_test.go @@ -46,7 +46,7 @@ func TestPeerCertificateMarshalJSON(t *testing.T) { var certs = []*x509.Certificate{cert} addr := "www.authz.com/auth" - req, err := http.NewRequest("GET", addr, nil) + req, err := http.NewRequest(http.MethodGet, addr, nil) assert.NilError(t, err) req.RequestURI = addr diff --git a/pkg/authorization/authz_unix_test.go b/pkg/authorization/authz_unix_test.go index c38b5e1566..584ef89104 100644 --- a/pkg/authorization/authz_unix_test.go +++ b/pkg/authorization/authz_unix_test.go @@ -38,7 +38,7 @@ func TestAuthZRequestPluginError(t *testing.T) { User: "user", RequestBody: []byte("sample body"), RequestURI: "www.authz.com/auth", - RequestMethod: "GET", + RequestMethod: http.MethodGet, RequestHeaders: map[string]string{"header": "value"}, } server.replayResponse = Response{ @@ -69,7 +69,7 @@ func TestAuthZRequestPlugin(t *testing.T) { User: "user", RequestBody: []byte("sample body"), RequestURI: "www.authz.com/auth", - RequestMethod: "GET", + RequestMethod: http.MethodGet, RequestHeaders: map[string]string{"header": "value"}, } server.replayResponse = Response{ diff --git a/pkg/authorization/middleware_unix_test.go b/pkg/authorization/middleware_unix_test.go index 450e7fbbb7..b399d2b805 100644 --- a/pkg/authorization/middleware_unix_test.go +++ b/pkg/authorization/middleware_unix_test.go @@ -34,7 +34,7 @@ func TestMiddlewareWrapHandler(t *testing.T) { assert.Assert(t, mdHandler != nil) addr := "www.example.com/auth" - req, _ := http.NewRequest("GET", addr, nil) + req, _ := http.NewRequest(http.MethodGet, addr, nil) req.RequestURI = addr req.Header.Add("header", "value")