nodejs / http-parser

http request/response parser for c
MIT License
6.32k stars 1.53k forks source link

Parsing trailers #495

Closed Chuongv closed 4 years ago

Chuongv commented 4 years ago

I noticed that when the http-parser parses trailers, it does not call the on_headers_complete after the trailers have been parsed. It instead goes to on_message_complete

Is that the intended behavior? Was not sure if my implementation is wrong or if this is expected.

bnoordhuis commented 4 years ago

Yes, that's the expected behavior. on_headers_complete signals the transition from headers to body, on_message_complete from body or trailing headers to end-of-message.

Chuongv commented 4 years ago

Sweet thanks, that aligns with what I am seeing.