-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: remove node-http-proxy and instead install package from npm and patch it #29499
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Bump this version to force CI to re-create the cache from scratch. | ||
|
||
04-22-24 | ||
05-10-24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AtofStryker Is this case sensitive? Would be a bit ridiculous if it is, but they are in all caps in the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which docs are you referring to? Are you saying the
readyState
is in caps?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is a Websocket that conforms to MDN standards,
WebSocket.readyState
is a number that corresponds toWebSocket.OPEN
, etc. It looks like socket-io also conforms to this. What's creating this socket, and what type is it? Thestream()
method here isn't called directly byhttp-proxy
, so it must be getting called frompackages/server
, or as an internal node lifecycle type process.readyState
also doesn't seem to be a property on duplex streams, which is what anode
http/httpssocket
is.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However,
socket
is implied to be a duplex stream (I believe) incheckMethodAndHeader
with the use of.destroy()
, which is a member ofDuplex
but is not a member ofWebSocket
... what the heck is this value? 🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/readyState
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logging the value of
socket
here during thewebsockets_spec
system test, and it looks like a decorated Duplex stream - it has stream related properties, likedestroyed
,_readableState
, and_writeableState
, but it also has properties describing a server:It does not, however, have a
readyState
property, so I'm not certain this conditional will ever evaluate as true.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to log the value of
socket.readyState
directly. It's not enumerable and it returnsundefined
forObject.getOwnPropertyDescriptor(socket, 'readyState')
but when accessed directly:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this is the Socket.readyState property