david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[http] Accept headers with no whitespace following the colon

Reported-by: Raphael Cohn <raphael.cohn@stormmq.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2016-06-09 12:20:35 +01:00
parent f76210961c
commit b42e71921f
1 changed files with 6 additions and 2 deletions

View File

@ -1201,13 +1201,17 @@ static int http_parse_header ( struct http_transaction *http, char *line ) {
DBGC2 ( http, "HTTP %p RX %s\n", http, line );
/* Extract header name */
sep = strstr ( line, ": " );
sep = strchr ( line, ':' );
if ( ! sep ) {
DBGC ( http, "HTTP %p malformed header \"%s\"\n", http, line );
return -EINVAL_HEADER;
}
*sep = '\0';
line = ( sep + 2 /* ": " */ );
/* Extract remainder of line */
line = ( sep + 1 );
while ( isspace ( *line ) )
line++;
/* Process header, if recognised */
for_each_table_entry ( header, HTTP_RESPONSE_HEADERS ) {