Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Range verification should not fail media responses #7782

Merged
merged 8 commits into from
May 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -2459,7 +2459,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li>`<dfn data-x="http-cache-control" data-x-href="https://tools.ietf.org/html/rfc7234#section-5.2"><code>Cache-Control</code></dfn>` header</li>
<li>`<dfn data-x="http-content-disposition" data-x-href="https://tools.ietf.org/html/rfc6266"><code>Content-Disposition</code></dfn>` header</li>
<li>`<dfn data-x="http-content-language" data-x-href="https://tools.ietf.org/html/rfc7231#section-3.1.3.2"><code>Content-Language</code></dfn>` header</li>
<li>`<dfn data-x="http-content-range" data-x-href="https://httpwg.org/specs/rfc7233.html#header.content-range"><code>Content-Range</code></dfn>` header</li>
<li>`<dfn data-x="http-last-modified" data-x-href="https://tools.ietf.org/html/rfc7232#section-2.2"><code>Last-Modified</code></dfn>` header</li>
<li>`<dfn data-x="http-range" data-x-href="https://httpwg.org/specs/rfc7233.html#header.range"><code>Range</code></dfn>` header</li>
<li>`<dfn data-x="http-referer" data-x-href="https://tools.ietf.org/html/rfc7231#section-5.5.2"><code>Referer</code></dfn>` header</li>
</ul>

Expand Down Expand Up @@ -35090,9 +35092,24 @@ interface <dfn interface>MediaError</dfn> {
<li><p>Let <var>internalResponse</var> be <var>response</var>'s
<span>unsafe response</span>.</p></li>

domenic marked this conversation as resolved.
Show resolved Hide resolved
<li><p>If <var>internalResponse</var>'s <span data-x="concept-response-status">status</span> is
200, then return true.</p></li>

<li><p>If <var>internalResponse</var>'s <span data-x="concept-response-status">status</span> is
not 206, then return false.</p></li>

<li>
domenic marked this conversation as resolved.
Show resolved Hide resolved
<p>If the result of <span
data-x="extract content-range values">extracting content-range values</span> from
<var>internalResponse</var> is failure, then return false.</p>

<p class="note">Note that the extracted values are not used, and in particular are not compared
to <var>byteRange</var>. So this step serves as syntactic validation of the `<code
data-x="http-content-range">Content-Range</code>` header, but if the `<code
data-x="http-content-range">Content-Range</code>` values on the response mismatch the `<code
data-x="http-range">Range</code>` values on the request, that is not considered a failure.</p>
</li>

<li><p>Let <var>origin</var> be "<code data-x="">rewritten</code>" if
<var>internalResponse</var>'s <span data-x="concept-response-url">URL</span> is null; otherwise
<var>internalResponse</var>'s <span data-x="concept-response-url">URL</span>'s
Expand Down Expand Up @@ -35125,14 +35142,6 @@ interface <dfn interface>MediaError</dfn> {
by being patched together with other responses from different origins.</p>
</li>

<li><p>Let (<var>start</var>, <var>end</var>) be the result of
<span data-x="extract content-range values">extracting content-range values</span> from
domenic marked this conversation as resolved.
Show resolved Hide resolved
<var>internalResponse</var>.</p></li>

<li><p>If <var>start</var> is not <var>byteRange</var>[0], or if
<var>byteRange</var>[1] is neither "<code data-x="">until end</code>" or <var>end</var>,
return false.</p></li>

<li><p>Return true.</p></li>
</ol>

Expand Down