Skip to content

Commit

Permalink
[http] Accept headers with no whitespace following the colon
Browse files Browse the repository at this point in the history
Reported-by: Raphael Cohn <raphael.cohn@stormmq.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Jun 9, 2016
1 parent f762109 commit b42e719
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/net/tcp/httpcore.c
Expand Up @@ -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 ) {
Expand Down

0 comments on commit b42e719

Please sign in to comment.