From 077c997464b3d55b105cc3431fd6607c67f159c5 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Thu, 19 Sep 2019 11:37:38 +0100 Subject: [PATCH] fix: only do the big file workaround in node and electron main --- package.json | 8 ++++---- src/lib/error-handler.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 921f6cb2c..65e1a650a 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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" }, diff --git a/src/lib/error-handler.js b/src/lib/error-handler.js index 88754e7aa..032a6acc8 100644 --- a/src/lib/error-handler.js +++ b/src/lib/error-handler.js @@ -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') @@ -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 }