Skip to content

Commit d20e8c9

Browse files
authored
Hard-code localhost to loopback addresses
Incorporate the recommendation of https://datatracker.ietf.org/doc/html/draft-ietf-dnsop-let-localhost-be-localhost to hard-code the resolution of *.localhost domains to ::1 and 127.0.0.1. This allows user agents to ensure that localhost contexts meet the secure context requirements laid out in https://w3c.github.io/webappsec-secure-contexts/#localhost.
1 parent 0cee83d commit d20e8c9

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

fetch.bs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2207,11 +2207,21 @@ unset or <a for=request>keepalive</a> is false, <a lt=terminated for=fetch>termi
22072207
<h3 id=resolving-domains>Resolving domains</h3>
22082208

22092209
<p tracking-vector>To <dfn>resolve a domain</dfn>, given a <a for=/>network partition key</a>
2210-
<var>key</var> and a <a for=/>domain</a> <var>domain</var>, perform an <a>implementation-defined</a>
2211-
operation to turn <var>domain</var> into a <a for=/>set</a> of one or more
2212-
<a for=/>IP addresses</a>. If this operation succeeds, return the <a for=/>set</a> of
2213-
<a for=/>IP addresses</a>. If it fails, return failure. The results of this operation may be cached.
2214-
If they are cached, <var>key</var> should be used as part of the cache key.
2210+
<var>key</var> and a <a for=/>domain</a> <var>domain</var>:
2211+
2212+
<ol>
2213+
<li><p>If <var>domain</var> is a <a for=/>host</a> whose <a for=host>public suffix</a> is
2214+
"<code>localhost</code>", then return « <code>::1</code>, <code>127.0.0.1</code> ».
2215+
2216+
<li><p>Perform an <a>implementation-defined</a> operation to turn <var>domain</var> into a
2217+
<a for=/>set</a> of one or more <a for=/>IP addresses</a>. If this operation succeeds, return the
2218+
<a for=/>set</a> of <a for=/>IP addresses</a>.
2219+
2220+
<li><p>Return failure.
2221+
</ol>
2222+
2223+
<p>The results of <a>resolve a domain</a> may be cached. If they are cached, <var>key</var> should
2224+
be used as part of the cache key.
22152225

22162226
<div class=note>
22172227
<p>Typically this operation would involve DNS and as such caching can happen on DNS servers without

0 commit comments

Comments
 (0)