Files
ladybird/Libraries/LibHTTP/HeaderList.cpp
Praise-Garfield b270b2cacb LibHTTP: Fix inverted Content-Range complete-length parsing
parse_single_byte_content_range_as_values() has the condition on
consume_specific('*') inverted. When the complete-length is a
numeric value like "1000", the negated check causes the wildcard
branch to run, discarding the length. When it is "*" (unknown),
the else branch tries to parse digits after consuming the "*",
which fails entirely.

Removing the "!" fixes both cases so that "*" correctly produces
an empty complete_length, and numeric values are parsed normally.

Also adds an EOF check after parsing to reject trailing garbage,
matching the pattern used by parse_single_range_header_value().
2026-02-13 09:39:49 +01:00

12 KiB