]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[http] Accept headers with no whitespace following the colon
authorMichael Brown <mcb30@ipxe.org>
Thu, 9 Jun 2016 11:20:35 +0000 (12:20 +0100)
committerMichael Brown <mcb30@ipxe.org>
Thu, 9 Jun 2016 11:27:04 +0000 (12:27 +0100)
Reported-by: Raphael Cohn <raphael.cohn@stormmq.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/net/tcp/httpcore.c

index 57b89762015fc1f3bf83a4c4b752151f7f11572e..b1f74bc4fb0f8a63357bac9942a0f5a0bb5f3136 100644 (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 ) {