Browse Source

storage node: fix passing arg to filter and correct use of Option

Mokhtar Naamani 4 years ago
parent
commit
67f811ecf0

+ 1 - 1
storage-node/packages/colossus/paths/asset/v0/{id}.js

@@ -122,7 +122,7 @@ module.exports = function(flags, storage, runtime)
             debug('Detected file info:', info);
 
             // Filter
-            const filter_result = filter(config, req.headers, info.mime_type);
+            const filter_result = filter(flags, req.headers, info.mime_type);
             if (200 != filter_result.code) {
               debug('Rejecting content', filter_result.message);
               stream.end();

+ 4 - 2
storage-node/packages/runtime-api/assets.js

@@ -64,7 +64,9 @@ class AssetsApi {
       throw new Error(`No DataObject created for content ID: ${contentId}`)
     }
 
-    if (obj.liaison.neq(storageProviderId)) {
+    obj = obj.unwrap()
+
+    if (!obj.liaison.eq(storageProviderId)) {
       throw new Error(`This storage node is not liaison for the content ID: ${contentId}`)
     }
 
@@ -72,7 +74,7 @@ class AssetsApi {
       throw new Error(`Expected Pending judgement, but found: ${obj.liaison_judgement.type}`)
     }
 
-    return obj.unwrap()
+    return obj
   }
 
   /*