[core] adjust offset if response header blank line

When backend returns an invalid response header which is exactly a
blank line (\n or \r\n), adjust the offset so as not to discard the
first character following, which is probably intended to be the
beginning of the response body.
personal/stbuehler/fix-fdevent
Glenn Strauss 5 years ago
parent de937f47f8
commit e7f5e24aeb

@ -1075,7 +1075,7 @@ handler_t http_response_parse_headers(server *srv, connection *con, http_respons
if (b->ptr[0] == '\n' || (b->ptr[0] == '\r' && b->ptr[1] == '\n')) {
/* no HTTP headers */
i = (b->ptr[0] == '\n') ? 1 : 2;
i = (b->ptr[0] == '\n') ? 0 : 1;
is_header_end = 1;
} else if (is_nph || b->ptr[(i = strcspn(b->ptr, ":\n"))] == ':') {
/* HTTP headers */

Loading…
Cancel
Save