Treat an existing Kubo MFS entry as a successful share
The MFS name includes the CID, so 'already has entry' means the same content is already there; re-sharing a file no longer fails.
This commit is contained in:
1 parent
c2d18b431e
commit
abcf6c2eae
2 files changed
+51
-1
No files matched your search
@@ -153,7 +153,9 @@ class IpfsUploadHelper {
|
||||
final response = await (client == null
|
||||
? http.post(copyUri, headers: headers)
|
||||
: client.post(copyUri, headers: headers));
|
||||
if (response.statusCode < 200 || response.statusCode >= 300) {
|
||||
final alreadyCopied = response.body.contains('already has entry');
|
||||
if ((response.statusCode < 200 || response.statusCode >= 300) &&
|
||||
!alreadyCopied) {
|
||||
throw Exception(
|
||||
'Kubo MFS import failed (${response.statusCode}): ${response.body}',
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user