Skip to content

Commit a2f6ab6

Browse files
committed
fix headers
1 parent 3b83272 commit a2f6ab6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

market/mk12/cidgravity.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ const cidGravityMinerCheckLabel = "cidg-miner-status-check"
106106
const agentName = "curio"
107107

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

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

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

145150
// Execute the request

0 commit comments

Comments
 (0)