Bug 143512
| Summary: | Accept-Ranges parsing | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Mark Nottingham <mnot> |
| Component: | WebCore Misc. | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | rcombs |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Mark Nottingham
In /WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp StreamingClient::handleResponseReceived(), the HTTP Accept-Ranges header is parsed like this:
"""
priv->seekable = length > 0 && g_ascii_strcasecmp("none", response.httpHeaderField(HTTPHeaderName::AcceptRanges).utf8().data()
"""
This means that if the string "none" shows up in the header at all, it will match -- making it error-prone if a range using that sequence of characters is ever defined.
The syntax isn't difficult to parse, it's a comma-separated list of tokens with optional whitespace (the same as several other headers):
http://httpwg.github.io/specs/rfc7233.html#header.accept-ranges
(found by Rodger Combs on the IETF HTTP WG mailing list)
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Ridley Combs
Correction: the current implementation matches only if the header value is exactly "none", which means it'd be error-prone if the server reported some range unit other than "bytes" (the one WebKit actually supports).
Ridley Combs
Ping; noticed that Firefox fixed a similar bug earlier today.