You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 6, 2022. It is now read-only.
There are some comments in http_parser.cc, line 1837:
/* Here we call the headers_complete callback. This is somewhat
* different than other callbacks because if the user returns 1, we
* will interpret that as saying that this message has no body. This
* is needed for the annoying case of recieving a response to a HEAD
* request.
*
* We'd like to use CALLBACK_NOTIFY_NOADVANCE() here but we cannot, so
* we have to simulate it by handling a change in errno below.
*/
Excludes the HEAD request, the 1xx, 204, 304 response also have Content-Length but do not have HTTP body.
So maybe the following code should add:
if (settings->on_headers_complete) {
switch (settings->on_headers_complete(parser)) {
case 0:
if (status_code / 100 == 1 || status_code == 204 || status_code == 304)
parser->flags |= F_SKIPBODY;
break;