Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
fix: big downloads in electron
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
  • Loading branch information
alanshaw committed Sep 11, 2019
1 parent 0ff4d52 commit 9c9aac8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/error-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const { HTTPError } = require('ky-universal')
const log = require('debug')('ipfs-http-client:lib:error-handler')
const { isNode } = require('ipfs-utils/src/env')
const { isNode, isElectron } = require('ipfs-utils/src/env')

function isJsonResponse (res) {
return (res.headers.get('Content-Type') || '').startsWith('application/json')
Expand All @@ -18,7 +18,7 @@ module.exports = async function errorHandler (input, options, response) {
//
// If the body in the clone is not consumed or destroyed the highwater mark
// will be reached (for large payloads) and stop the real body from flowing.
if (isNode) response.body.destroy()
if (isNode || isElectron) response.body.destroy()
return
}

Expand Down

0 comments on commit 9c9aac8

Please sign in to comment.