1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

pkg/authorization: use constants for http methods

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2019-10-12 20:43:46 +02:00
parent 9c590ed5c5
commit 5ba167ce8a
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
3 changed files with 4 additions and 4 deletions

View file

@ -46,7 +46,7 @@ func TestPeerCertificateMarshalJSON(t *testing.T) {
var certs = []*x509.Certificate{cert} var certs = []*x509.Certificate{cert}
addr := "www.authz.com/auth" addr := "www.authz.com/auth"
req, err := http.NewRequest("GET", addr, nil) req, err := http.NewRequest(http.MethodGet, addr, nil)
assert.NilError(t, err) assert.NilError(t, err)
req.RequestURI = addr req.RequestURI = addr

View file

@ -38,7 +38,7 @@ func TestAuthZRequestPluginError(t *testing.T) {
User: "user", User: "user",
RequestBody: []byte("sample body"), RequestBody: []byte("sample body"),
RequestURI: "www.authz.com/auth", RequestURI: "www.authz.com/auth",
RequestMethod: "GET", RequestMethod: http.MethodGet,
RequestHeaders: map[string]string{"header": "value"}, RequestHeaders: map[string]string{"header": "value"},
} }
server.replayResponse = Response{ server.replayResponse = Response{
@ -69,7 +69,7 @@ func TestAuthZRequestPlugin(t *testing.T) {
User: "user", User: "user",
RequestBody: []byte("sample body"), RequestBody: []byte("sample body"),
RequestURI: "www.authz.com/auth", RequestURI: "www.authz.com/auth",
RequestMethod: "GET", RequestMethod: http.MethodGet,
RequestHeaders: map[string]string{"header": "value"}, RequestHeaders: map[string]string{"header": "value"},
} }
server.replayResponse = Response{ server.replayResponse = Response{

View file

@ -34,7 +34,7 @@ func TestMiddlewareWrapHandler(t *testing.T) {
assert.Assert(t, mdHandler != nil) assert.Assert(t, mdHandler != nil)
addr := "www.example.com/auth" addr := "www.example.com/auth"
req, _ := http.NewRequest("GET", addr, nil) req, _ := http.NewRequest(http.MethodGet, addr, nil)
req.RequestURI = addr req.RequestURI = addr
req.Header.Add("header", "value") req.Header.Add("header", "value")