From 8129c5808e3717838dfb5a32f886a48fa24ed8a9 Mon Sep 17 00:00:00 2001 From: Alex Goodman Date: Fri, 25 Aug 2023 15:39:11 -0400 Subject: [PATCH] need capitalized http methods (#119) Signed-off-by: Alex Goodman --- quill/notary/http_client.go | 4 ++-- quill/notary/http_client_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/quill/notary/http_client.go b/quill/notary/http_client.go index 07ece8e6..86935207 100644 --- a/quill/notary/http_client.go +++ b/quill/notary/http_client.go @@ -29,7 +29,7 @@ func newHTTPClient(token string, httpTimeout time.Duration) *httpClient { } func (s httpClient) get(ctx context.Context, endpoint string, body io.Reader) (*http.Response, error) { - request, err := http.NewRequest("get", endpoint, body) + request, err := http.NewRequest(http.MethodGet, endpoint, body) if err != nil { return nil, err } @@ -38,7 +38,7 @@ func (s httpClient) get(ctx context.Context, endpoint string, body io.Reader) (* } func (s httpClient) post(ctx context.Context, endpoint string, body io.Reader) (*http.Response, error) { - request, err := http.NewRequest("post", endpoint, body) + request, err := http.NewRequest(http.MethodPost, endpoint, body) if err != nil { return nil, err } diff --git a/quill/notary/http_client_test.go b/quill/notary/http_client_test.go index d3f8cb91..41d62cd7 100644 --- a/quill/notary/http_client_test.go +++ b/quill/notary/http_client_test.go @@ -13,7 +13,7 @@ import ( func Test_httpClient_get(t *testing.T) { s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - assert.Equal(t, "get", r.Method) + assert.Equal(t, "GET", r.Method) return })) defer s.Close() @@ -27,7 +27,7 @@ func Test_httpClient_get(t *testing.T) { func Test_httpClient_post(t *testing.T) { s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - assert.Equal(t, "post", r.Method) + assert.Equal(t, "POST", r.Method) return })) defer s.Close()