Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yutakahirano committed Dec 5, 2016
1 parent 38d57a1 commit 2ab2fce
Showing 1 changed file with 37 additions and 17 deletions.
54 changes: 37 additions & 17 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ user-agent-defined <a for=header>value</a> for the
<li><p>A <dfn export for=body id=concept-body-total-bytes>total bytes</dfn> (an
integer), initially 0.

<li><p>A <dfn export for=body id=concept-body-replayable>replayable flag</dfn>, initially unset.
<li><p>A <dfn export for=body id=concept-body-source>source</dfn>, initially null.
</ul>

<p>A <a for=/>body</a> <var>body</var> is said to be
Expand Down Expand Up @@ -3029,8 +3029,7 @@ in addition to <a>HTTP fetch</a> above.

<li><p>If <var>actualResponse</var>'s <a for=response>status</a> is not <code>303</code>,
<var>request</var>'s <a for=request>body</a> is non-null, and <var>request</var>'s
<a for=request>body</a>'s <a for=body>replayable flag</a> is unset, then return a
<a>network error</a>.
<a for=request>body</a>'s <a for=body>source</a> is null, then return a <a>network error</a>.

<li>
<p>If <i>CORS flag</i> is set and <var>actualResponse</var>'s
Expand All @@ -3056,6 +3055,17 @@ in addition to <a>HTTP fetch</a> above.
to `<code>GET</code>` and <var>request</var>'s <a for=request>body</a>
to null.

<li>
<p>If <var>request</var>'s <a for=request>body</a> is not null, then set <var>request</var>'s
<a for=request>body</a> to the first part of <a lt=extract for=BodyInit>extracting</a>
<var>request</var>'s <a for=request>body</a>'s <a for=body>source</a>.

<p class="note no-backref"><var>request</var>'s <a for=request>body</a>'s <a for=body>source</a>'s
nullity has already been checked.

<p class="note no-backref">The <a lt=extract for=BodyInit>extracting</a> operation cannot throw
as it was called for the same <a for=body>source</a> before.

<li><p>Append <var>actualResponse</var>'s
<a for=response>location URL</a> to <var>request</var>'s
<a for=request>url list</a>.
Expand Down Expand Up @@ -3091,8 +3101,7 @@ steps:
<var>request</var> otherwise.

<p class="note no-backref">A <var>request</var> is typically cloned as it needs to be possible to
add <a>headers</a> and read its
<a for=request>body</a> without affecting <var>request</var>. As
add <a>headers</a> without affecting <var>request</var>. As
<var>request</var> is reused with redirects, authentication, and proxy authentication.

<li>
Expand Down Expand Up @@ -3373,9 +3382,22 @@ steps:
<li class=XXX><p>Needs testing: multiple `<code>WWW-Authenticate</code>` headers, missing,
parsing issues.

<li><p>If <var>request</var>'s <a for=request>body</a> is non-null and <var>request</var>'s
<a for=request>body</a>'s <a for=body>replayable flag</a> is unset, then return a
<a>network error</a>.
<li>
<p>If <var>request</var>'s <a for=request>body</a> is non-null, then run these subsubsteps:

<ol>
<li><p>If <var>request</var>'s <a for=request>body</a>'s <a for=body>source</a> is null,
then return a <a>network error</a>.

<li>
<p>
<p>Set <var>request</var>'s <a for=request>body</a> to the first part of
<a lt=extract for=BodyInit>extracting</a> <var>request</var>'s <a for=request>body</a>'s
<a for=body>source</a>.

<p class="note no-backref">The <a lt=extract for=BodyInit>extracting</a> operation cannot
throw as it was called for the same <a for=body>source</a> before.
</ol>

<li>
<p>If <var>request</var>'s
Expand Down Expand Up @@ -4266,7 +4288,7 @@ typedef (Blob or BufferSource or FormData or URLSearchParams or ReadableStream o

<li><p>Let <var>action</var> be null.

<li><p>Let <var>replayable</var> be false.
<li><p>Let <var>source</var> be null.

<li>
<p>Switch on <var>object</var>'s type:
Expand All @@ -4279,7 +4301,7 @@ typedef (Blob or BufferSource or FormData or URLSearchParams or ReadableStream o
<p>If <var>object</var>'s {{Blob/type}}
attribute is not the empty byte sequence, set <var>Content-Type</var> to its value.

<p>Set <var>replayable</var> to true.
<p>Set <var>source</var> to object.

<dt><code>BufferSource</code>
<dd>
Expand All @@ -4289,7 +4311,7 @@ typedef (Blob or BufferSource or FormData or URLSearchParams or ReadableStream o
<var>stream</var>. If that threw an exception,
<a abstract-op>error</a> <var>stream</var> with that exception.

<p>Set <var>replayable</var> to true.
<p>Set <var>source</var> to object.

<dt>{{FormData}}
<dd>
Expand All @@ -4303,7 +4325,7 @@ typedef (Blob or BufferSource or FormData or URLSearchParams or ReadableStream o
<a><code>multipart/form-data</code> boundary string</a> generated by the
<a><code>multipart/form-data</code> encoding algorithm</a>.

<p>Set <var>replayable</var> to true.
<p>Set <var>source</var> to object.

<dt>{{URLSearchParams}}
<dd>
Expand All @@ -4316,15 +4338,15 @@ typedef (Blob or BufferSource or FormData or URLSearchParams or ReadableStream o
<p>Set <var>Content-Type</var> to
`<code>application/x-www-form-urlencoded;charset=UTF-8</code>`.

<p>Set <var>replayable</var> to true.
<p>Set <var>source</var> to object.

<dt><code>USVString</code>
<dd>
<p>Set <var>action</var> to an action that runs <a>utf-8 encode</a> on <var>object</var>.

<p>Set <var>Content-Type</var> to `<code>text/plain;charset=UTF-8</code>`.

<p>Set <var>replayable</var> to true.
<p>Set <var>source</var> to object.

<dt>{{ReadableStream}}
<dd><p>Set <var>stream</var> to <var>object</var>.
Expand All @@ -4350,9 +4372,7 @@ typedef (Blob or BufferSource or FormData or URLSearchParams or ReadableStream o
</ol>

<li><p>Let <var>body</var> be a <a for=/>body</a> whose <a for=body>stream</a> is
<var>stream</var>.

<li><p>Set <var>body</var>'s <a for=body>replayable flag</a> if <var>replayable</var> is true.
<var>stream</var> and whose <a fore=body>source</a> is <var>source</var>.

<li><p>Return <var>body</var> and <var>Content-Type</var>.
</ol>
Expand Down

0 comments on commit 2ab2fce

Please sign in to comment.