Skip to content

Commit 1756a4e

Browse files
committed
update to utilize post for api call due to IPFS protocol upgrade which disallow non-POST call
1 parent 40d9896 commit 1756a4e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/CoreApi/FileSystemApi.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ internal FileSystemApi(IpfsClient ipfs)
194194
/// </returns>
195195
public Task<Stream> ReadFileAsync(string path, CancellationToken cancel = default(CancellationToken))
196196
{
197-
return ipfs.DownloadAsync("cat", cancel, path);
197+
return ipfs.PostDownloadAsync("cat", cancel, path);
198198
}
199199

200200
public Task<Stream> ReadFileAsync(string path, long offset, long length = 0, CancellationToken cancel = default(CancellationToken))
@@ -207,7 +207,7 @@ internal FileSystemApi(IpfsClient ipfs)
207207

208208
if (length == 0)
209209
length = int.MaxValue; // go-ipfs only accepts int lengths
210-
return ipfs.DownloadAsync("cat", cancel, path,
210+
return ipfs.PostDownloadAsync("cat", cancel, path,
211211
$"offset={offset}",
212212
$"length={length}");
213213
}
@@ -255,7 +255,7 @@ internal FileSystemApi(IpfsClient ipfs)
255255

256256
public Task<Stream> GetAsync(string path, bool compress = false, CancellationToken cancel = default(CancellationToken))
257257
{
258-
return ipfs.DownloadAsync("get", cancel, path, $"compress={compress}");
258+
return ipfs.PostDownloadAsync("get", cancel, path, $"compress={compress}");
259259
}
260260
}
261261
}

src/CoreApi/ObjectApi.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ internal ObjectApi(IpfsClient ipfs)
5151

5252
public Task<Stream> DataAsync(Cid id, CancellationToken cancel = default(CancellationToken))
5353
{
54-
return ipfs.DownloadAsync("object/data", cancel, id);
54+
return ipfs.PostDownloadAsync("object/data", cancel, id);
5555
}
5656

5757
public async Task<IEnumerable<IMerkleLink>> LinksAsync(Cid id, CancellationToken cancel = default(CancellationToken))

0 commit comments

Comments
 (0)