fetch() and net scopes give a non-ASCII host its UTS #46 ToASCII form
Date: 2026-11-30
Area: runtime, url, permissions
Supersedes: ADR 0216's "The HTTP client's own parse skips UTS #46",
and ADR 0149's "What the client refuses today stays refused" for a
non-ASCII host; their other decisions stand.
Related: #2449, #2411,
Permissions — net scopes, Fetch
Context
Since #2411 the URL parser gives a special-scheme domain with a non-ASCII code point its UTS #46 ToASCII form
(WHATWG URL §3.3, domain to ASCII), so new URL("https://bücher.example/").host is xn--bcher-kva.example. ADR 0216
kept fetch() out of that: NormalizeHTTPRequestURL and ResolveHTTPRedirectURL parsed with
AKeepNonASCIIDomain, so a non-ASCII host reached the net checks as written and the built-in client refused it
(HTTP host contains a non-ASCII code unit), as ADR 0149 had it. A net scope had to be ASCII, so a permission list
could not name such a host in the spelling a script writes. A script could not fetch an internationalized domain at
all. Johannes chose on 2026-11-30 to convert the host in fetch() and in the scopes ("Agreed with a").
Decision
fetch()sends a non-ASCII host in its ToASCII form.NormalizeHTTPRequestURLandResolveHTTPRedirectURLparse with the URL Standard's host parser and its ToASCII (Goccia.URL.IDNA), percent-encoded or not.fetchCheckjudges the URL normalized asfetchStartsends it, so the firstnetcheck, every redirect hop's check, the built-in client and an embedder's transport all see the ASCII form, andPermissionDenied's scope andResponse.urlname it.- A
netscope written in Unicode is read in its ToASCII form.TryParseNetScopereads the scope's syntax (private, a CIDR's/, a port and a wildcard's*.) on the text as written, then converts the host name with the URL parser's own domain step (TryURLDomainToASCII), and a scope is stored in that form. Sobücher.exampleandxn--bcher-kva.examplename the same host, in the list and, throughfetch()'s conversion, in the request; matching a stored scope runs no UTS #46, whose loops poll the run's limits on the engine's thread. Syntax that only mapping makes, such as a full-width*orprivatein full-width letters, is not a scope. - A host ToASCII refuses stays refused. The parse falls back to keeping the domain's code points
(
AKeepNonASCIIDomain), so such a host reaches thenetchecks as the name the script wrote and the client refuses it before any lookup, as before. A scope ToASCII refuses is an invalid scope.
Consequences
- A request's host, its denial and its
Response.urluse the formnew URL()gives; a script that comparedPermissionDenied.scopewith a Unicode name sees the ASCII one. AKeepNonASCIIDomainremains only for that fallback and for the check of a transport's final URL, which takes a domain as written and so runs no IDNA where the transport answers; a host only ToASCII makes valid there, such as an IPv4 address in full-width digits, is refused. The URL is given its ASCII form when the answer is settled.- A denial or an explanation names a scope in its ASCII form, and a request's host is matched as given: an embedder
that asks
AllowsNetHostitself converts a Unicode host first, asfetch()does.