llhttp icon indicating copy to clipboard operation
llhttp copied to clipboard

how can get the status code string

Open aengusjiang opened this issue 3 years ago • 3 comments

aengusjiang avatar Aug 04 '22 07:08 aengusjiang

for the old repo http_parse has a method to get the status code string which named http_status_str. How about add the similar method in this repo such as llhttp_status_str

aengusjiang avatar Aug 04 '22 07:08 aengusjiang

Since you might receive the status in different chunks, you need to implement the on_status and on_status_complete callbacks to store the string yourself. The library doesn't allocate memory on its own.

pallas avatar Aug 08 '22 22:08 pallas

No. I mean that convert int status to string. the http_parser.h line 421 in http_pasrer lib have the convert method, just a map. https://github.com/nodejs/http-parser/blob/main/http_parser.h

aengusjiang avatar Aug 09 '22 05:08 aengusjiang

Duplicate of https://github.com/nodejs/llhttp/issues/106

ShogunPanda avatar Aug 22 '22 14:08 ShogunPanda