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

Commit

Permalink
fix: only do the big file workaround in node and electron main
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomrdias committed Sep 19, 2019
1 parent 7934103 commit 077c997
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"fs-extra": "^8.1.0",
"glob": "^7.1.3",
"ipfs-block": "~0.8.1",
"ipfs-utils": "^0.3.0",
"ipfs-utils": "^0.4.0",
"ipld-dag-cbor": "~0.15.0",
"ipld-dag-pb": "~0.17.3",
"ipld-raw": "^4.0.0",
Expand Down Expand Up @@ -101,15 +101,15 @@
"through2": "^3.0.1"
},
"devDependencies": {
"aegir": "^20.2.0",
"aegir": "^20.3.1",
"browser-process-platform": "~0.1.1",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"cross-env": "^5.2.1",
"cross-env": "^6.0.0",
"dirty-chai": "^2.0.1",
"go-ipfs-dep": "^0.4.22",
"interface-ipfs-core": "~0.114.0",
"ipfsd-ctl": "^0.46.2",
"ipfsd-ctl": "^0.47.1",
"nock": "^11.3.2",
"stream-equal": "^1.1.1"
},
Expand Down
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, isElectron } = require('ipfs-utils/src/env')
const { isNode, isElectronMain } = 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 || isElectron) response.body.destroy()
if (isNode || isElectronMain) response.body.destroy()
return
}

Expand Down

0 comments on commit 077c997

Please sign in to comment.