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

dkg: add content type to lock file post #1907

Merged
merged 1 commit into from
Mar 20, 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
1 change: 1 addition & 0 deletions app/obolapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func httpPost(ctx context.Context, url *url.URL, b []byte) error {
if err != nil {
return errors.Wrap(err, "new POST request with ctx")
}
req.Header.Add("Content-Type", `application/json`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid backtick strings.


res, err := new(http.Client).Do(req)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions app/obolapi/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func TestLockPublish(t *testing.T) {
t.Run("2xx response", func(t *testing.T) {
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
require.Equal(t, r.URL.Path, "/lock")
require.Equal(t, r.Header.Get("Content-Type"), "application/json")

data, err := io.ReadAll(r.Body)
require.NoError(t, err)
Expand Down