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

fix: only do the big file workaround in node and electron main #1113

Merged
merged 1 commit into from
Sep 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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