Skip to content

Commit b32dcb0

Browse files
fix(DagApi): default content is "dag-cbor" not "cbor"
1 parent d2fe660 commit b32dcb0

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/CoreApi/DagApi.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ internal DagApi(IpfsClient ipfs)
2626

2727
public async Task<Cid> PutAsync(
2828
JObject data,
29-
string contentType = "cbor",
29+
string contentType = "dag-cbor",
3030
string multiHash = MultiHash.DefaultAlgorithmName,
3131
bool pin = true,
3232
CancellationToken cancel = default(CancellationToken))
@@ -47,7 +47,12 @@ public async Task<Cid> PutAsync(
4747
}
4848
}
4949

50-
public async Task<Cid> PutAsync(object data, string contentType = "cbor", string multiHash = "sha2-256", bool pin = true, CancellationToken cancel = default(CancellationToken))
50+
public async Task<Cid> PutAsync(
51+
object data,
52+
string contentType = "dag-cbor",
53+
string multiHash = MultiHash.DefaultAlgorithmName,
54+
bool pin = true,
55+
CancellationToken cancel = default(CancellationToken))
5156
{
5257
using (var ms = new MemoryStream(
5358
Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(data)),
@@ -59,8 +64,8 @@ public async Task<Cid> PutAsync(
5964

6065
public async Task<Cid> PutAsync(
6166
Stream data,
62-
string contentType = "cbor",
63-
string multiHash = "sha2-256",
67+
string contentType = "dag-cbor",
68+
string multiHash = MultiHash.DefaultAlgorithmName,
6469
bool pin = true,
6570
CancellationToken cancel = default(CancellationToken))
6671
{

src/IpfsApi.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</PropertyGroup>
2828

2929
<ItemGroup>
30-
<PackageReference Include="Ipfs.Core" Version="0.27.3" />
30+
<PackageReference Include="Ipfs.Core" Version="0.27.4" />
3131
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
3232
<PackageReference Include="System.Net.Http" Version="4.3.3" Condition="'$(TargetFramework)' == 'netstandard14'" />
3333
<PackageReference Include="System.Net.Http" Version="4.3.3" Condition="'$(TargetFramework)' == 'net45'" />

0 commit comments

Comments
 (0)