Skip to content

Commit

Permalink
chore: add normalize response
Browse files Browse the repository at this point in the history
  • Loading branch information
OasisLCrypto committed Nov 25, 2024
1 parent 631dc34 commit 138b891
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion walrus.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,11 @@ func (c *Client) Store(data []byte, opts *StoreOptions) (*StoreResponse, error)
}

var storeResp StoreResponse

if err := json.Unmarshal(respData, &storeResp); err != nil {
return nil, fmt.Errorf("failed to parse response: %w", err)
}
storeResp.NormalizeBlobResponse()

return &storeResp, nil
}
Expand Down Expand Up @@ -176,7 +178,7 @@ func (c *Client) StoreReader(reader io.Reader, contentLength int64, opts *StoreO
if err := json.Unmarshal(respData, &storeResp); err != nil {
return nil, fmt.Errorf("failed to parse response: %w", err)
}

storeResp.NormalizeBlobResponse()
return &storeResp, nil
}

Expand Down

0 comments on commit 138b891

Please sign in to comment.