-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Allow statusCode
and statusMessage
to be changed on IncomingMessage
#8368
Conversation
❌ @autofix-ci[bot] 4 files with test failures on bun-darwin-aarch64:
|
❌ @autofix-ci[bot] 5 files with test failures on linux-x64-baseline: |
❌ @autofix-ci[bot] 9 files with test failures on linux-x64:
|
❌ @autofix-ci[bot] 8 files with test failures on bun-darwin-x64:
|
return this[statusMessageSymbol] ?? STATUS_CODES[this[reqSymbol].status]; | ||
}, | ||
set(value) { | ||
this[statusMessageSymbol] = 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.
For context:
Node http2 uses a symbol called 'state'
:
https://github.com/nodejs/node/blob/main/lib/internal/http2/compat.js#L71
Related to IncomingMessage however Node uses a data property (not accessor):
https://github.com/nodejs/node/blob/main/lib/_http_incoming.js#L88
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.
yeah, we should just set the property on the object and not use a getter/setter
❌🪟 @autofix-ci[bot], there are 12 test regressions on Windows x86_64
|
Any plans for this PR or is it ready to merge? |
What does this PR do?
ngrok
is changing thestatusCode
andstatusMessage
on incoming requests, which fixes the following issue:Unfortunately,
ngrok
still doesn't work. (it hangs instead of error) But I figured we should get this fix out anyway.How did you verify your code works?
There are tests.