Skip to content

Commit

Permalink
fix headers
Browse files Browse the repository at this point in the history
  • Loading branch information
LexLuthr committed Feb 11, 2025
1 parent 3b83272 commit a2f6ab6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions market/mk12/cidgravity.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ const cidGravityMinerCheckLabel = "cidg-miner-status-check"
const agentName = "curio"

var commonHeaders = http.Header{
"X-Agent": []string{"curio-market-storage-filter"},
"X-Agent-Version": []string{"1.0"},
"Content-Type": []string{"application/json"},
"X-CIDgravity-Agent": []string{"CIDgravity-storage-Connector"},
"X-CIDgravity-Version": []string{"1.0"},
"Content-Type": []string{"application/json"},
}

func (m *MK12) cidGravityCheck(ctx context.Context, deal *ProviderDealState) (bool, string, error) {
Expand All @@ -130,6 +130,9 @@ func (m *MK12) cidGravityCheck(ctx context.Context, deal *ProviderDealState) (bo
}
if lableStr == cidGravityMinerCheckLabel {
req, err = http.NewRequest("POST", cidGravityMinerCheckUrl, bytes.NewBuffer(data))
if err != nil {
return false, "", xerrors.Errorf("Error creating request: %v", err)
}
}
} else {
req, err = http.NewRequest("POST", cidGravityDealCheckUrl, bytes.NewBuffer(data))
Expand All @@ -140,6 +143,8 @@ func (m *MK12) cidGravityCheck(ctx context.Context, deal *ProviderDealState) (bo

// Add necessary headers
req.Header = commonHeaders
req.Header.Set("X-API-KEY", m.cfg.Market.StorageMarketConfig.MK12.CIDGravityToken)
req.Header.Set("X-Address-ID", deal.ClientDealProposal.Proposal.Provider.String())
req.Header.Set("Authorization", m.cfg.Market.StorageMarketConfig.MK12.CIDGravityToken)

// Execute the request
Expand Down

0 comments on commit a2f6ab6

Please sign in to comment.