File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,27 @@ module.exports = (send) => {
21
21
return callback ( new Error ( '"files" must be a buffer, readable stream, or array of objects' ) )
22
22
}
23
23
24
- const request = { path : 'add' , files : files , qs : opts }
24
+ const qs = { }
25
+
26
+ if ( opts [ 'cid-version' ] != null ) {
27
+ qs [ 'cid-version' ] = opts [ 'cid-version' ]
28
+ } else if ( opts . cidVersion != null ) {
29
+ qs [ 'cid-version' ] = opts . cidVersion
30
+ }
31
+
32
+ if ( opts [ 'raw-leaves' ] != null ) {
33
+ qs [ 'raw-leaves' ] = opts [ 'raw-version' ]
34
+ } else if ( opts . rawLeaves != null ) {
35
+ qs [ 'raw-leaves' ] = opts . rawLeaves
36
+ }
37
+
38
+ if ( opts . hash != null ) {
39
+ qs . hash = opts . hash
40
+ } else if ( opts . hashAlg != null ) {
41
+ qs . hash = opts . hashAlg
42
+ }
43
+
44
+ const request = { path : 'add' , files : files , qs : qs }
25
45
26
46
// Transform the response stream to DAGNode values
27
47
const transform = ( res , callback ) => DAGNodeStream . streamToValue ( send , res , callback )
You can’t perform that action at this time.
0 commit comments