Skip to content

Commit

Permalink
Fix various cases that should have talked about the internal response…
Browse files Browse the repository at this point in the history
…, but didn't. Fixes #23 again (and better this time).
  • Loading branch information
annevk committed Jul 15, 2015
1 parent 07ed6ea commit c83edf6
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 66 deletions.
73 changes: 40 additions & 33 deletions Overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -1599,20 +1599,6 @@ <h3 id="main-fetch"><span class="secno">5.1 </span>Main fetch</h3>
<li><p>If <a href="#concept-main-fetch" title="concept-main-fetch">main fetch</a> is invoked recursively, return
<var title="">response</var>.

<li><p>Set <var title="">response</var>'s
<a href="#concept-response-url-list" title="concept-response-url-list">url list</a> to a copy of
<var title="">request</var>'s <a href="#concept-request-url-list" title="concept-request-url-list">url list</a>.

<li><p>If
<a href="https://w3c.github.io/webappsec/specs/mixedcontent/#should-block-response">should <var>response</var> to <var>request</var> be blocked as mixed content</a>,
<span class="XXX">should <var><a href="#response">response</a></var> to <var><a href="#request">request</a></var> be blocked as content security</span>,
or
<a href="#should-response-to-request-be-blocked-due-to-nosniff?">should <var title="">response</var> to <var title="">request</var> be blocked due to nosniff</a>
returns <b title="">blocked</b>, set <var title="">response</var> to a
<a href="#concept-network-error" title="concept-network-error">network error</a>.
<a href="#refsMIX">[MIX]</a>
<a href="#refsCSP">[CSP]</a>

<li>
<p>If <var title="">response</var> is not a
<a href="#concept-network-error" title="concept-network-error">network error</a> and
Expand All @@ -1634,25 +1620,39 @@ <h3 id="main-fetch"><span class="secno">5.1 </span>Main fetch</h3>
<dd><a href="#concept-filtered-response-opaque" title="concept-filtered-response-opaque">opaque filtered response</a>
</dl>

<li><p>Let <var>internalResponse</var> be <var title="">response</var>'s
<a href="#concept-internal-response" title="concept-internal-response">internal response</a>.

<li><p>Set <var title="">internalResponse</var>'s
<a href="#concept-response-url-list" title="concept-response-url-list">url list</a> to a copy of
<var title="">request</var>'s <a href="#concept-request-url-list" title="concept-request-url-list">url list</a>.

<li><p>If
<a href="https://w3c.github.io/webappsec/specs/mixedcontent/#should-block-response">should <var>internalResponse</var> to <var>request</var> be blocked as mixed content</a>,
<span class="XXX">should <var>internalResponse</var> to <var title="">request</var> be blocked as content security</span>,
or
<span>should <var>internalResponse</var> to <var><a href="#request">request</a></var> be blocked due to nosniff</span>
returns <b title="">blocked</b>, set <var title="">response</var> to a
<a href="#concept-network-error" title="concept-network-error">network error</a>.
<a href="#refsMIX">[MIX]</a>
<a href="#refsCSP">[CSP]</a>

<li>
<p>If <var title="">request</var>'s <a href="#concept-request-method" title="concept-request-method">method</a>
is `<code title="">HEAD</code>` or `<code title="">CONNECT</code>`, or
<var title="">response</var>'s
<a href="#concept-internal-response" title="concept-internal-response">internal response</a>'s
<var title="">internalResponse</var>'s
<a href="#concept-response-status" title="concept-response-status">status</a> is <code title="">101</code>,
<code title="">204</code>, <code title="">205</code>, or <code title="">304</code>, set
<var title="">response</var>'s
<a href="#concept-internal-response" title="concept-internal-response">internal response</a>'s
<a href="#concept-response-body" title="concept-response-body">body</a> to null and disregard any pushing toward
it (if any).
<var title="">internalResponse</var>'s <a href="#concept-response-body" title="concept-response-body">body</a> to
null and disregard any pushing toward it (if any).

<p class="note">This standardizes the error handling for servers that violate HTTP.

<li>
<p>If <var title="">request</var>'s <a href="#synchronous-flag">synchronous flag</a> is set, wait for
either end-of-file to have been pushed to
<var title="">response</var>'s <a href="#concept-response-body" title="concept-response-body">body</a> or for
<var title="">response</var> to have a
<var title="">internalResponse</var>'s <a href="#concept-response-body" title="concept-response-body">body</a> or for
<var title="">internalResponse</var> to have a
<a href="#concept-response-termination-reason" title="concept-response-termination-reason">termination reason</a>, and then
return <var title="">response</var>.

Expand All @@ -1670,7 +1670,7 @@ <h3 id="main-fetch"><span class="secno">5.1 </span>Main fetch</h3>
<dfn id="process-response">process response</dfn> for <var title="">response</var>.

<li>
<p>If <var title="">response</var>'s
<p>If <var title="">internalResponse</var>'s
<a href="#concept-response-body" title="concept-response-body">body</a> is null, run these substeps:

<ol>
Expand All @@ -1682,22 +1682,22 @@ <h3 id="main-fetch"><span class="secno">5.1 </span>Main fetch</h3>
</ol>

<li>
<p>Otherwise, if <var title="">response</var>'s
<p>Otherwise, if <var title="">internalResponse</var>'s
<a href="#concept-response-body" title="concept-response-body">body</a> is non-null, run these substeps:

<ol>
<li><p>Whenever <var title="">response</var>'s
<li><p>Whenever <var title="">internalResponse</var>'s
<a href="#concept-response-body" title="concept-response-body">body</a>'s is pushed to, for and as long as
<var title="">response</var> has no
<var title="">internalResponse</var> has no
<a href="#concept-response-termination-reason" title="concept-response-termination-reason">termination reason</a> and
end-of-file has not been pushed,
<a href="#queue-a-fetch-task">queue a fetch task</a> on <var title="">request</var> to
<a href="#process-response-body">process response body</a> for <var title="">response</var>.

<li>
<p>Once end-of-file has been pushed to <var title="">response</var>'s
<a href="#concept-response-body" title="concept-response-body">body</a> or <var title="">response</var> has a
<a href="#concept-response-termination-reason" title="concept-response-termination-reason">termination reason</a>,
<p>Once end-of-file has been pushed to <var title="">internalResponse</var>'s
<a href="#concept-response-body" title="concept-response-body">body</a> or <var title="">internalResponse</var> has
a <a href="#concept-response-termination-reason" title="concept-response-termination-reason">termination reason</a>,
<a href="#queue-a-fetch-done-task">queue a fetch-done task</a> using <var title="">request</var> and
<var title="">response</var>.

Expand Down Expand Up @@ -1973,9 +1973,15 @@ <h3 id="http-fetch"><span class="secno">5.3 </span>HTTP fetch</h3>
<a href="#concept-response" title="concept-response">response</a> from a service worker.
</ol>

<li>Let <var title="">status</var> be <var title="">response</var>'s
<a href="#concept-response-status" title="concept-response-status">status</a>, if <var title="">response</var> is not a
<a href="#concept-filtered-response" title="concept-filtered-response">filtered response</a>, and
<var title="">response</var>'s
<a href="#concept-internal-response" title="concept-internal-response">internal response</a>'s
<a href="#concept-response-status" title="concept-response-status">status</a> otherwise.

<li>
<p>Then, switch on <var title="">response</var>'s
<a href="#concept-response-status" title="concept-response-status">status</a>:
<p>Switch on <var title="">status</var>:

<dl class="switch">
<dt><code title="">304</code>
Expand Down Expand Up @@ -2163,8 +2169,9 @@ <h3 id="http-fetch"><span class="secno">5.3 </span>HTTP fetch</h3>
<a href="#refsHTTPAUTH">[HTTPAUTH]</a>

<li><p>Return <var title="">response</var>. <span class="note no-backref">Typically
<var title="">response</var>'s <a href="#concept-response-body" title="concept-response-body">body</a> is still being
pushed to after returning.</span>
<var title="">response</var>'s <a href="#concept-response-body" title="concept-response-body">body</a> (or that of the
<a href="#concept-internal-response" title="concept-internal-response">internal response</a>) is still being pushed to
after returning.</span>
</ol>


Expand Down
73 changes: 40 additions & 33 deletions Overview.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -1546,20 +1546,6 @@ <h3>Main fetch</h3>
<li><p>If <span title=concept-main-fetch>main fetch</span> is invoked recursively, return
<var title>response</var>.

<li><p>Set <var title>response</var>'s
<span title=concept-response-url-list>url list</span> to a copy of
<var title>request</var>'s <span title=concept-request-url-list>url list</span>.

<li><p>If
<a href=https://w3c.github.io/webappsec/specs/mixedcontent/#should-block-response>should <var>response</var> to <var>request</var> be blocked as mixed content</a>,
<span class=XXX>should <var>response</var> to <var>request</var> be blocked as content security</span>,
or
<span>should <var title>response</var> to <var title>request</var> be blocked due to nosniff</span>
returns <b title>blocked</b>, set <var title>response</var> to a
<span title=concept-network-error>network error</span>.
<span data-anolis-ref>MIX</span>
<span data-anolis-ref>CSP</span>

<li>
<p>If <var title>response</var> is not a
<span title=concept-network-error>network error</span> and
Expand All @@ -1581,25 +1567,39 @@ <h3>Main fetch</h3>
<dd><span title=concept-filtered-response-opaque>opaque filtered response</span>
</dl>

<li><p>Let <var>internalResponse</var> be <var title>response</var>'s
<span title=concept-internal-response>internal response</span>.

<li><p>Set <var title>internalResponse</var>'s
<span title=concept-response-url-list>url list</span> to a copy of
<var title>request</var>'s <span title=concept-request-url-list>url list</span>.

<li><p>If
<a href=https://w3c.github.io/webappsec/specs/mixedcontent/#should-block-response>should <var>internalResponse</var> to <var>request</var> be blocked as mixed content</a>,
<span class=XXX>should <var>internalResponse</var> to <var title>request</var> be blocked as content security</span>,
or
<span>should <var>internalResponse</var> to <var>request</var> be blocked due to nosniff</span>
returns <b title>blocked</b>, set <var title>response</var> to a
<span title=concept-network-error>network error</span>.
<span data-anolis-ref>MIX</span>
<span data-anolis-ref>CSP</span>

<li>
<p>If <var title>request</var>'s <span title=concept-request-method>method</span>
is `<code title>HEAD</code>` or `<code title>CONNECT</code>`, or
<var title>response</var>'s
<span title=concept-internal-response>internal response</span>'s
<var title>internalResponse</var>'s
<span title=concept-response-status>status</span> is <code title>101</code>,
<code title>204</code>, <code title>205</code>, or <code title>304</code>, set
<var title>response</var>'s
<span title=concept-internal-response>internal response</span>'s
<span title=concept-response-body>body</span> to null and disregard any pushing toward
it (if any).
<var title>internalResponse</var>'s <span title=concept-response-body>body</span> to
null and disregard any pushing toward it (if any).

<p class=note>This standardizes the error handling for servers that violate HTTP.

<li>
<p>If <var title>request</var>'s <span>synchronous flag</span> is set, wait for
either end-of-file to have been pushed to
<var title>response</var>'s <span title=concept-response-body>body</span> or for
<var title>response</var> to have a
<var title>internalResponse</var>'s <span title=concept-response-body>body</span> or for
<var title>internalResponse</var> to have a
<span title=concept-response-termination-reason>termination reason</span>, and then
return <var title>response</var>.

Expand All @@ -1617,7 +1617,7 @@ <h3>Main fetch</h3>
<dfn>process response</dfn> for <var title>response</var>.

<li>
<p>If <var title>response</var>'s
<p>If <var title>internalResponse</var>'s
<span title=concept-response-body>body</span> is null, run these substeps:

<ol>
Expand All @@ -1629,22 +1629,22 @@ <h3>Main fetch</h3>
</ol>

<li>
<p>Otherwise, if <var title>response</var>'s
<p>Otherwise, if <var title>internalResponse</var>'s
<span title=concept-response-body>body</span> is non-null, run these substeps:

<ol>
<li><p>Whenever <var title>response</var>'s
<li><p>Whenever <var title>internalResponse</var>'s
<span title=concept-response-body>body</span>'s is pushed to, for and as long as
<var title>response</var> has no
<var title>internalResponse</var> has no
<span title=concept-response-termination-reason>termination reason</span> and
end-of-file has not been pushed,
<span>queue a fetch task</span> on <var title>request</var> to
<span>process response body</span> for <var title>response</var>.

<li>
<p>Once end-of-file has been pushed to <var title>response</var>'s
<span title=concept-response-body>body</span> or <var title>response</var> has a
<span title=concept-response-termination-reason>termination reason</span>,
<p>Once end-of-file has been pushed to <var title>internalResponse</var>'s
<span title=concept-response-body>body</span> or <var title>internalResponse</var> has
a <span title=concept-response-termination-reason>termination reason</span>,
<span>queue a fetch-done task</span> using <var title>request</var> and
<var title>response</var>.

Expand Down Expand Up @@ -1920,9 +1920,15 @@ <h3>HTTP fetch</h3>
<span title=concept-response>response</span> from a service worker.
</ol>

<li>Let <var title>status</var> be <var title>response</var>'s
<span title=concept-response-status>status</span>, if <var title>response</var> is not a
<span title=concept-filtered-response>filtered response</span>, and
<var title>response</var>'s
<span title=concept-internal-response>internal response</span>'s
<span title=concept-response-status>status</span> otherwise.

<li>
<p>Then, switch on <var title>response</var>'s
<span title=concept-response-status>status</span>:
<p>Switch on <var title>status</var>:

<dl class=switch>
<dt><code title>304</code>
Expand Down Expand Up @@ -2110,8 +2116,9 @@ <h3>HTTP fetch</h3>
<span data-anolis-ref>HTTPAUTH</span>

<li><p>Return <var title>response</var>. <span class="note no-backref">Typically
<var title>response</var>'s <span title=concept-response-body>body</span> is still being
pushed to after returning.</span>
<var title>response</var>'s <span title=concept-response-body>body</span> (or that of the
<span title=concept-internal-response>internal response</span>) is still being pushed to
after returning.</span>
</ol>


Expand Down

0 comments on commit c83edf6

Please sign in to comment.