-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
http: add rawPacket in err of clientError
event
#17672
Changes from 1 commit
e9eb792
5e1369f
0e73e2c
9758fb1
008e5a8
7fb6c62
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -765,6 +765,11 @@ object, so any HTTP response sent, including response headers and payload, | |
*must* be written directly to the `socket` object. Care must be taken to | ||
ensure the response is a properly formatted HTTP response message. | ||
|
||
> `err` is an instance of `Error` with two extra columns: | ||
> | ||
> + `bytesParsed`: the bytes count of request packet that Node.js may parse correctly; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/parse correctly/have parsed incorrectly/? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's the count of 'correctly', not 'incorrectly'. Means Node.js have parsed |
||
> + `rawPacket`: the raw packet of current request. | ||
|
||
### Event: 'close' | ||
<!-- YAML | ||
added: v0.1.4 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -476,6 +476,7 @@ function onParserExecuteCommon(server, socket, parser, state, ret, d) { | |
resetSocketTimeout(server, socket, state); | ||
|
||
if (ret instanceof Error) { | ||
ret.rawPacket = d || parser.getCurrentBuffer(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure, but can you maybe move the if (!d)
d = parser.getCurrentBuffer(); block in front of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Refs: #17672 (comment) |
||
debug('parse error', ret); | ||
socketOnError.call(socket, ret); | ||
} else if (parser.incoming && parser.incoming.upgrade) { | ||
|
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.
Why the
>
blockquote?