<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>143512</bug_id>
          
          <creation_ts>2015-04-07 21:54:24 -0700</creation_ts>
          <short_desc>Accept-Ranges parsing</short_desc>
          <delta_ts>2018-08-07 16:01:19 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mark Nottingham">mnot</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>rcombs</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1083545</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Nottingham">mnot</who>
    <bug_when>2015-04-07 21:54:24 -0700</bug_when>
    <thetext>In /WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp StreamingClient::handleResponseReceived(), the HTTP Accept-Ranges header is parsed like this:


&quot;&quot;&quot;
    priv-&gt;seekable = length &gt; 0 &amp;&amp; g_ascii_strcasecmp(&quot;none&quot;, response.httpHeaderField(HTTPHeaderName::AcceptRanges).utf8().data()
&quot;&quot;&quot;

This means that if the string &quot;none&quot; 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&apos;t difficult to parse, it&apos;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)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1083593</commentid>
    <comment_count>1</comment_count>
    <who name="Ridley Combs">rcombs</who>
    <bug_when>2015-04-08 06:27:26 -0700</bug_when>
    <thetext>Correction: the current implementation matches only if the header value is exactly &quot;none&quot;, which means it&apos;d be error-prone if the server reported some range unit other than &quot;bytes&quot; (the one WebKit actually supports).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1448612</commentid>
    <comment_count>2</comment_count>
    <who name="Ridley Combs">rcombs</who>
    <bug_when>2018-08-07 16:01:19 -0700</bug_when>
    <thetext>Ping; noticed that Firefox fixed a similar bug earlier today.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>