Closed ldcsaa closed 3 years ago
Looks like coverage in 4cc13c09 wasn't exhaustive. @pallas : could you take a look at it?
Yes, I can take a look. These are both "special" headers, so I probably just missed a path they're in. Note: I am also very not proficient with Node.js or llparse.
Also, this is a new feature, so no reason to roll back: it doesn't break anything that isn't trying to use the new complete callbacks, those callbacks are just missing something.
@pallas totally agree. This can be fixed without reverts. If you have any questions or if something is looking confusing - let me know! I'd love to help/collaborate.
@ldcsaa can you please try with the above patch?
@indutny thanks for the offer, I think I untangled it all.. it was a pretty obvious mistake on my part in retrospect and it would have been caught if I had done better testing
@ldcsaa can you please try with the above patch?
I had test it, the bug has fixed ~
Awesome! Glad someone else is using this feature, sorry for the bug in the first place.
I came across this issue when trying to parse the following request and figured there is a fix on the way.
GET /home?name=Carter&age=6 HTTP/1.1\r\n
Content-Length: 11\r\n
Connection: close\r\n
Foo: bar\r\n\r\n
Hello World
When handling the on_message_complete
shouldn't llhttp_t.content_length
be set to 11
?
@dccarter it would be 11
in on_headers_complete
complete callback, but the field value is undefined at the time of on_message_complete
(it is used internally after on_headers_complete
)
@dccarter it would be
11
inon_headers_complete
complete callback, but the field value is undefined at the time ofon_message_complete
(it is used internally afteron_headers_complete
)
Thanks for quick response
These is my code (VC 2010)
When I run this program, 'Content-Length' and 'Connection' header does NOT trigger _on_header_field_complete event. (PS: 'Content-Type' and 'User-Agent' header does trigger on_header_field_complete_ event )