diff --git a/src/net/tcp/httpcore.c b/src/net/tcp/httpcore.c index aa15b112..6552ca2b 100644 --- a/src/net/tcp/httpcore.c +++ b/src/net/tcp/httpcore.c @@ -33,6 +33,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include +#include #include #include #include @@ -441,7 +442,7 @@ static int http_rx_content_length ( struct http_request *http, char *value ) { /* Parse content length */ content_len = strtoul ( value, &endp, 10 ); - if ( *endp != '\0' ) { + if ( ! ( ( *endp == '\0' ) || isspace ( *endp ) ) ) { DBGC ( http, "HTTP %p invalid Content-Length \"%s\"\n", http, value ); return -EINVAL_CONTENT_LENGTH;