Skip to content

Commit

Permalink
Fetch API
Browse files Browse the repository at this point in the history
  • Loading branch information
iVanlIsh committed Nov 10, 2023
1 parent 0d95ff9 commit 5c65f08
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions index.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,11 @@ <h2 id="framework">Framework</h2>

<h3 id="ip-address-space-heading">IP Address Space</h3>

Define {{IPAddressSpace}} as follows:
<pre class="idl">
enum IPAddressSpace { "public","private", "local" };
</pre>

Every IP address belongs to an
<dfn export local-lt="address space">IP address space</dfn>, which can be one
of three different values:
Expand Down Expand Up @@ -963,10 +968,6 @@ <h4 id="fetch-api">Fetch API</h4>

The Fetch API needs to be adjusted as well.

- Define {{IPAddressSpace}} as follows.
<pre class="idl">
enum IPAddressSpace { "public","private", "local" };
</pre>
- Append an optional [=map/entry=] to {{RequestInfo}}, whose [=map/key=] is
<dfn export>targetAddressSpace</dfn>, and [=map/value=] is a
{{IPAddressSpace}}.
Expand All @@ -975,25 +976,33 @@ <h4 id="fetch-api">Fetch API</h4>
IPAddressSpace targetAddressSpace;
};
</pre>

- Define a new {=targetAddressSpace=} representing the
above in [=request=].
<pre class="idl">
partial interface Request {
readonly attribute IPAddressSpace targetAddressSpace;
};
</pre>

- The <a constructor for=Request lt="Request(input, init)"><code>new
Request(<var ignore=''>input</var>, |init|)</code></a> is
appended with the following step right before setting [=this=]'s [=request=]
to |request|:
1. If |init|["{{RequestInit/targetAddressSpace}}"] [=map/exists=], and
|request|'s [=request/client=] is a [=secure context=], then switch on
|init|["{{RequestInit/targetAddressSpace}}"]:
1. If |init|["{{RequestInit/targetAddressSpace}}"] [=map/exists=], then
switch on |init|["{{RequestInit/targetAddressSpace}}"]:
<dl class=switch>
<dt>public
<dd>Set |request|'s [=target IP address space=] to [=IP address
space/public=]
<dd>Ignore it and keep |request|'s [=target IP address space=] as
null.

<dt>private
<dd>Set |request|'s [=target IP address space=] to [=IP address
space/private=].

<dt>local
<dd>Set |request|'s [=target IP address space=] to [=IP address
space/local=]
space/local=].
</dl>

<h4 id="forbidden-header-names">Forbidden header names</h4>
Expand Down

0 comments on commit 5c65f08

Please sign in to comment.