Skip to content

Commit

Permalink
Fail on non ok status codes in dac fulfillemnt post
Browse files Browse the repository at this point in the history
  • Loading branch information
idmitriev committed Sep 14, 2023
1 parent 63dc222 commit 18e0d59
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dac/pkg/collection_point.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"encoding/json"
"fmt"
"github.com/cerebellum-network/cere-ddc-sdk-go/core/pkg/crypto"
log "github.com/sirupsen/logrus"
"io"
"net/http"
"net/url"
Expand Down Expand Up @@ -57,14 +56,15 @@ func (d dacCollectionPoint) SaveFulfillment(fulfillment Fulfillment) error {
ctx, cancel := context.WithTimeout(context.Background(), dacTimeout)
defer cancel()

log.Info(fmt.Sprint(string(json)))

req, err := http.NewRequestWithContext(
ctx,
"POST",
d.url.String()+fulfillmentPath,
bytes.NewBuffer(json),
)

req.Header.Set("Content-Type", "application/json")

if err != nil {
return fmt.Errorf("failed to create request: %w", err)
}
Expand Down

0 comments on commit 18e0d59

Please sign in to comment.