From 486a9b07bade83e8b31586448fa6d4258a70e75d Mon Sep 17 00:00:00 2001 From: AtofStryker Date: Thu, 9 May 2024 14:04:54 -0400 Subject: [PATCH] chore: remove node-http-proxy and instead install package from npm and patch it [run ci] --- .circleci/cache-version.txt | 2 +- packages/server/package.json | 3 +- .../server/patches/http-proxy+1.18.1.patch | 61 +++++++++++++++ yarn.lock | 75 ++----------------- 4 files changed, 70 insertions(+), 71 deletions(-) create mode 100644 packages/server/patches/http-proxy+1.18.1.patch diff --git a/.circleci/cache-version.txt b/.circleci/cache-version.txt index e28e8ca9e43d..485aa19ed9d7 100644 --- a/.circleci/cache-version.txt +++ b/.circleci/cache-version.txt @@ -1,3 +1,3 @@ # Bump this version to force CI to re-create the cache from scratch. -04-22-24 +05-10-24 diff --git a/packages/server/package.json b/packages/server/package.json index a746e12c01d0..fcc25d8f4021 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -75,7 +75,7 @@ "getos": "3.2.1", "glob": "7.1.3", "graceful-fs": "4.2.9", - "http-proxy": "https://github.com/cypress-io/node-http-proxy.git#9322b4b69b34f13a6f3874e660a35df3305179c6", + "http-proxy": "1.18.1", "human-interval": "1.0.0", "image-size": "0.8.3", "is-ci": "^3.0.1", @@ -218,6 +218,7 @@ "nohoist": [ "@benmalka/foxdriver", "devtools-protocol", + "http-proxy", "tsconfig-paths" ] }, diff --git a/packages/server/patches/http-proxy+1.18.1.patch b/packages/server/patches/http-proxy+1.18.1.patch new file mode 100644 index 000000000000..e9d4227eb7a2 --- /dev/null +++ b/packages/server/patches/http-proxy+1.18.1.patch @@ -0,0 +1,61 @@ +diff --git a/node_modules/http-proxy/.auto-changelog b/node_modules/http-proxy/.auto-changelog +old mode 100644 +new mode 100755 +diff --git a/node_modules/http-proxy/.gitattributes b/node_modules/http-proxy/.gitattributes +deleted file mode 100644 +index 1a6bd45..0000000 +--- a/node_modules/http-proxy/.gitattributes ++++ /dev/null +@@ -1 +0,0 @@ +-package-lock.json binary +diff --git a/node_modules/http-proxy/CHANGELOG.md b/node_modules/http-proxy/CHANGELOG.md +old mode 100644 +new mode 100755 +diff --git a/node_modules/http-proxy/CODE_OF_CONDUCT.md b/node_modules/http-proxy/CODE_OF_CONDUCT.md +old mode 100644 +new mode 100755 +diff --git a/node_modules/http-proxy/LICENSE b/node_modules/http-proxy/LICENSE +old mode 100644 +new mode 100755 +diff --git a/node_modules/http-proxy/README.md b/node_modules/http-proxy/README.md +old mode 100644 +new mode 100755 +diff --git a/node_modules/http-proxy/codecov.yml b/node_modules/http-proxy/codecov.yml +old mode 100644 +new mode 100755 +diff --git a/node_modules/http-proxy/index.js b/node_modules/http-proxy/index.js +old mode 100644 +new mode 100755 +diff --git a/node_modules/http-proxy/lib/http-proxy.js b/node_modules/http-proxy/lib/http-proxy.js +old mode 100644 +new mode 100755 +diff --git a/node_modules/http-proxy/lib/http-proxy/common.js b/node_modules/http-proxy/lib/http-proxy/common.js +old mode 100644 +new mode 100755 +diff --git a/node_modules/http-proxy/lib/http-proxy/index.js b/node_modules/http-proxy/lib/http-proxy/index.js +old mode 100644 +new mode 100755 +diff --git a/node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js b/node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js +old mode 100644 +new mode 100755 +diff --git a/node_modules/http-proxy/lib/http-proxy/passes/web-outgoing.js b/node_modules/http-proxy/lib/http-proxy/passes/web-outgoing.js +old mode 100644 +new mode 100755 +diff --git a/node_modules/http-proxy/lib/http-proxy/passes/ws-incoming.js b/node_modules/http-proxy/lib/http-proxy/passes/ws-incoming.js +old mode 100644 +new mode 100755 +index 270f23f..feac117 +--- a/node_modules/http-proxy/lib/http-proxy/passes/ws-incoming.js ++++ b/node_modules/http-proxy/lib/http-proxy/passes/ws-incoming.js +@@ -111,7 +111,7 @@ module.exports = { + proxyReq.on('error', onOutgoingError); + proxyReq.on('response', function (res) { + // if upgrade event isn't going to happen, close the socket +- if (!res.upgrade) { ++ if (!res.upgrade && socket.readyState === "open" && !socket.destroyed) { + socket.write(createHttpHeader('HTTP/' + res.httpVersion + ' ' + res.statusCode + ' ' + res.statusMessage, res.headers)); + res.pipe(socket); + } +diff --git a/node_modules/http-proxy/renovate.json b/node_modules/http-proxy/renovate.json +old mode 100644 +new mode 100755 diff --git a/yarn.lock b/yarn.lock index f2c45ce7df8e..60672fc232f6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18271,7 +18271,7 @@ http-proxy-middleware@^2.0.3: is-plain-obj "^3.0.0" micromatch "^4.0.2" -http-proxy@^1.17.0, http-proxy@^1.18.0, http-proxy@^1.18.1: +http-proxy@1.18.1, http-proxy@^1.17.0, http-proxy@^1.18.0, http-proxy@^1.18.1: version "1.18.1" resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549" integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ== @@ -18280,14 +18280,6 @@ http-proxy@^1.17.0, http-proxy@^1.18.0, http-proxy@^1.18.1: follow-redirects "^1.0.0" requires-port "^1.0.0" -"http-proxy@https://github.com/cypress-io/node-http-proxy.git#9322b4b69b34f13a6f3874e660a35df3305179c6": - version "1.18.0" - resolved "https://github.com/cypress-io/node-http-proxy.git#9322b4b69b34f13a6f3874e660a35df3305179c6" - dependencies: - eventemitter3 "^4.0.0" - follow-redirects "^1.0.0" - requires-port "^1.0.0" - http-server@0.12.3: version "0.12.3" resolved "https://registry.yarnpkg.com/http-server/-/http-server-0.12.3.tgz#ba0471d0ecc425886616cb35c4faf279140a0d37" @@ -22102,7 +22094,7 @@ mobx@5.15.4: resolved "https://registry.yarnpkg.com/mobx/-/mobx-5.15.4.tgz#9da1a84e97ba624622f4e55a0bf3300fb931c2ab" integrity sha512-xRFJxSU2Im3nrGCdjSuOTFmxVDGeqOHL+TyADCGbT0k4HHqGmx5u2yaHNryvoORpI4DfbzjJ5jPmuv+d7sioFw== -"mocha-7.0.1@npm:mocha@7.0.1": +"mocha-7.0.1@npm:mocha@7.0.1", mocha@7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.0.1.tgz#276186d35a4852f6249808c6dd4a1376cbf6c6ce" integrity sha512-9eWmWTdHLXh72rGrdZjNbG3aa1/3NRPpul1z0D979QpEnFdCG0Q5tv834N+94QEN2cysfV72YocQ3fn87s70fg== @@ -22235,36 +22227,6 @@ mocha@6.2.2: yargs-parser "13.1.1" yargs-unparser "1.6.0" -mocha@7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.0.1.tgz#276186d35a4852f6249808c6dd4a1376cbf6c6ce" - integrity sha512-9eWmWTdHLXh72rGrdZjNbG3aa1/3NRPpul1z0D979QpEnFdCG0Q5tv834N+94QEN2cysfV72YocQ3fn87s70fg== - dependencies: - ansi-colors "3.2.3" - browser-stdout "1.3.1" - chokidar "3.3.0" - debug "3.2.6" - diff "3.5.0" - escape-string-regexp "1.0.5" - find-up "3.0.0" - glob "7.1.3" - growl "1.10.5" - he "1.2.0" - js-yaml "3.13.1" - log-symbols "2.2.0" - minimatch "3.0.4" - mkdirp "0.5.1" - ms "2.1.1" - node-environment-flags "1.0.6" - object.assign "4.1.0" - strip-json-comments "2.0.1" - supports-color "6.0.0" - which "1.3.1" - wide-align "1.1.3" - yargs "13.3.0" - yargs-parser "13.1.1" - yargs-unparser "1.6.0" - mocha@7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.1.0.tgz#c784f579ad0904d29229ad6cb1e2514e4db7d249" @@ -28901,7 +28863,7 @@ string-template@~0.2.1: resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add" integrity sha1-QpMuWYo1LQH8IuwzZ9nYTuxsmt0= -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -28927,15 +28889,6 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^3.0.0, string-width@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" @@ -29037,7 +28990,7 @@ stringify-object@^3.0.0, stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -29079,13 +29032,6 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.1.1.tgz#39e8a98d044d150660abe4a6808acf70bb7bc991" @@ -32125,7 +32071,7 @@ workerpool@6.2.0: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.0.tgz#827d93c9ba23ee2019c3ffaff5c27fccea289e8b" integrity sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -32168,15 +32114,6 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.0.1, wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" @@ -32768,4 +32705,4 @@ zone.js@~0.11.4: resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.11.7.tgz#262194267c7b964e8da77ce16b9fba9bea23cfdc" integrity sha512-e39K2EdK5JfA3FDuUTVRvPlYV4aBfnOOcGuILhQAT7nzeV12uSrLBzImUM9CDVoncDSX4brR/gwqu0heQ3BQ0g== dependencies: - tslib "^2.3.0" \ No newline at end of file + tslib "^2.3.0"