Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit c9f879e

Browse files
committed
chore: upgrade ndjson and pull-stream-to-stream
1 parent d76f147 commit c9f879e

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,12 @@
173173
"pull-defer": "~0.2.3",
174174
"pull-file": "^1.1.0",
175175
"pull-mplex": "~0.1.1",
176-
"pull-ndjson": "~0.1.1",
176+
"pull-ndjson": "achingbrain/pull-ndjson#upgrade-deps",
177177
"pull-pushable": "^2.2.0",
178178
"pull-sort": "^1.0.1",
179179
"pull-stream": "^3.6.14",
180180
"pull-stream-to-async-iterator": "^1.0.2",
181-
"pull-stream-to-stream": "^1.3.4",
181+
"pull-stream-to-stream": "^2.0.0",
182182
"pull-traverse": "^1.0.3",
183183
"readable-stream": "^3.4.0",
184184
"receptacle": "^1.3.2",

src/http/api/resources/files-regular.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -336,17 +336,6 @@ exports.refs = {
336336
const unique = request.query.unique
337337
const maxDepth = request.query['max-depth']
338338

339-
// This is because ndjson.serialize writes a single \n into the response even if
340-
// the stream was empty - in the client we strip the \n from response and try to
341-
// parse what's left as JSON which then explodes, so if we know we're not going
342-
// to send anything back, shortcut the streaming of refs.
343-
if (maxDepth <= 0) {
344-
return h.response()
345-
.header('x-chunked-output', '1')
346-
.header('content-type', 'application/json')
347-
.header('Trailer', 'X-Stream-Error')
348-
}
349-
350339
const source = ipfs.refsPullStream(key, { recursive, format, edges, unique, maxDepth })
351340
return sendRefsReplyStream(request, h, `refs for ${key}`, source)
352341
}

0 commit comments

Comments
 (0)