diff --git a/package.json b/package.json index 9ff2f377e8..096769731e 100644 --- a/package.json +++ b/package.json @@ -295,7 +295,7 @@ "@types/gunzip-maybe": "^1.4.0", "@types/hoist-non-react-statics": "^3.3.1", "@types/html-webpack-plugin": "^3.2.6", - "@types/http-proxy": "^1.17.7", + "@types/http-proxy": "^1.17.8", "@types/jest": "^26.0.24", "@types/js-yaml": "^4.0.5", "@types/jsdom": "^16.2.14", diff --git a/src/main/lens-proxy.ts b/src/main/lens-proxy.ts index 3fdb437ea5..f37b7a087c 100644 --- a/src/main/lens-proxy.ts +++ b/src/main/lens-proxy.ts @@ -3,7 +3,7 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ -import type net from "net"; +import net from "net"; import type http from "http"; import spdy from "spdy"; import type httpProxy from "http-proxy"; @@ -188,7 +188,7 @@ export class LensProxy extends Singleton { }); proxy.on("error", (error, req, res, target) => { - if (this.closed) { + if (this.closed || res instanceof net.Socket) { return; } diff --git a/yarn.lock b/yarn.lock index 8a3d4ca209..29b458b062 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1557,13 +1557,6 @@ resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz#9140779736aa2655635ee756e2467d787cfe8a2a" integrity sha512-c3Xy026kOF7QOTn00hbIllV1dLR9hG9NkSrLQgCVs8NF6sBU+VGWjD3wLPhmh1TYAc7ugCFsvHYMN4VcBN1U1A== -"@types/http-proxy@^1.17.7": - version "1.17.7" - resolved "https://registry.yarnpkg.com/@types/http-proxy/-/http-proxy-1.17.7.tgz#30ea85cc2c868368352a37f0d0d3581e24834c6f" - integrity sha512-9hdj6iXH64tHSLTY+Vt2eYOGzSogC+JQ2H7bdPWkuh7KXP5qLllWx++t+K9Wk556c3dkDdPws/SpMRi0sdCT1w== - dependencies: - "@types/node" "*" - "@types/http-proxy@^1.17.8": version "1.17.8" resolved "https://registry.yarnpkg.com/@types/http-proxy/-/http-proxy-1.17.8.tgz#968c66903e7e42b483608030ee85800f22d03f55"