This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree 2 files changed +6
-7
lines changed
2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ exports = module.exports = function HttpApi (repo) {
19
19
20
20
this . start = ( callback ) => {
21
21
if ( typeof repo === 'string' ) {
22
- console . log ( 'here' )
23
22
repo = new IPFSRepo ( repo , { stores : fsbs } )
24
23
}
25
24
Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ exports.add = {
17
17
18
18
const parser = multipart . reqParser ( request . payload )
19
19
20
- var file = false
21
- var written = 0
20
+ var filesParsed = false
21
+ var filesAdded = 0
22
22
23
23
var serialize = ndjson . serialize ( )
24
24
// hapi doesn't permit object streams: http://hapijs.com/api#replyerr-result
@@ -31,11 +31,11 @@ exports.add = {
31
31
Name : file . path ,
32
32
Hash : bs58 . encode ( file . multihash ) . toString ( )
33
33
} )
34
- written ++
34
+ filesAdded ++
35
35
} )
36
36
37
37
fileAdder . on ( 'end' , ( ) => {
38
- if ( written === 0 && file ) {
38
+ if ( filesAdded === 0 && filesParsed ) {
39
39
return reply ( {
40
40
Message : 'Failed to add files' ,
41
41
Code : 0
@@ -53,12 +53,12 @@ exports.add = {
53
53
path : fileName ,
54
54
stream : fileStream
55
55
}
56
- file = true
56
+ filesParsed = true
57
57
fileAdder . write ( filePair )
58
58
} )
59
59
60
60
parser . on ( 'end' , ( ) => {
61
- if ( ! file ) {
61
+ if ( ! filesParsed ) {
62
62
return reply ( "File argument 'data' is required" ) . code ( 400 ) . takeover ( )
63
63
}
64
64
fileAdder . end ( )
You can’t perform that action at this time.
0 commit comments