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 7 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
23 changes: 15 additions & 8 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -35090,9 +35090,24 @@ interface <dfn interface>MediaError</dfn> {
<li><p>Let <var>internalResponse</var> be <var>response</var>'s
<span>unsafe response</span>.</p></li>

<li><p>If <var>internalResponse</var>'s <span data-x="concept-response-status">status</span> is
200, then return true.</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
not 206, then return false.</p></li>

<li>
<p>If 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> 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="">Content-Range</code> header, but if the <code data-x="">Content-Range</code> values on
the response mismatch the <code data-x="">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 +35140,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