Skip to content
This repository was archived by the owner on Nov 6, 2022. It is now read-only.

HTTP/1.1 responses w/o Content-Length or Transfer-Encoding #23

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion http_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,7 @@ size_t http_parser_execute (http_parser *parser,
/* Content-Length header given and non-zero */
state = s_body_identity;
} else {
if (parser->type == HTTP_REQUEST || http_should_keep_alive(parser)) {
if (parser->type == HTTP_REQUEST) {
/* Assume content-length 0 - read the next */
CALLBACK2(message_complete);
state = NEW_MESSAGE();
Expand Down
4 changes: 2 additions & 2 deletions test.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ const struct message responses[] =
,.type= HTTP_RESPONSE
,.raw= "HTTP/1.1 404 Not Found\r\n\r\n"
,.should_keep_alive= TRUE
,.message_complete_on_eof= FALSE
,.message_complete_on_eof= TRUE
,.http_major= 1
,.http_minor= 1
,.status_code= 404
Expand All @@ -652,7 +652,7 @@ const struct message responses[] =
,.type= HTTP_RESPONSE
,.raw= "HTTP/1.1 301\r\n\r\n"
,.should_keep_alive = TRUE
,.message_complete_on_eof= FALSE
,.message_complete_on_eof= TRUE
,.http_major= 1
,.http_minor= 1
,.status_code= 301
Expand Down