From: Michael Brown Date: Thu, 9 Jun 2016 11:20:35 +0000 (+0100) Subject: [http] Accept headers with no whitespace following the colon X-Git-Tag: v1.20.1~430 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b42e71921fb8169f2c5a409bd095f10bb3c0f1ac;p=thirdparty%2Fipxe.git [http] Accept headers with no whitespace following the colon Reported-by: Raphael Cohn Signed-off-by: Michael Brown --- diff --git a/src/net/tcp/httpcore.c b/src/net/tcp/httpcore.c index 57b897620..b1f74bc4f 100644 --- a/src/net/tcp/httpcore.c +++ b/src/net/tcp/httpcore.c @@ -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 ) {