Accept HTTP/0.9 responses

See joyent/node#1711
v0.6
Felix Geisendörfer 13 years ago committed by Ryan Dahl
parent f1d48aa31c
commit 2498961231

@ -515,7 +515,7 @@ size_t http_parser_execute (http_parser *parser,
break;
case s_res_first_http_major:
if (ch < '1' || ch > '9') {
if (ch < '0' || ch > '9') {
SET_ERRNO(HPE_INVALID_VERSION);
goto error;
}

@ -1041,8 +1041,24 @@ const struct message responses[] =
,.body= ""
}
#define HTTP_VERSION_0_9 12
/* Should handle HTTP/0.9 */
, {.name= "http version 0.9"
,.type= HTTP_RESPONSE
,.raw= "HTTP/0.9 200 OK\r\n"
"\r\n"
,.should_keep_alive= FALSE
,.message_complete_on_eof= TRUE
,.http_major= 0
,.http_minor= 9
,.status_code= 200
,.num_headers= 0
,.headers=
{}
,.body= ""
}
, {.name= NULL } /* sentinel */
};
int

Loading…
Cancel
Save