Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need capitalized http methods #119

Merged
merged 1 commit into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions quill/notary/http_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions quill/notary/http_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down
Loading