Bug 304164
| Summary: | REGRESSION (298981@main): fetch() throws TypeError when using targetAddressSpace: 'loopback' with localhost requests | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | 1433452387 |
| Component: | DOM | Assignee: | Ryosuke Niwa <rniwa> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | 1433452387, annevk, m_finkel, rniwa, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 26 | ||
| Hardware: | Mac (Apple Silicon) | ||
| OS: | macOS 26 | ||
1433452387
Description
When making a simple fetch() request to a locally deployed HTTP service (e.g. 127.0.0.1), Safari 26.2 throws a TypeError and immediately enters the catch block if the targetAddressSpace: 'loopback' option is provided.
This behavior does not occur in:
Safari 26.1
Chrome (where targetAddressSpace: 'loopback' is required for compatibility)
If any other arbitrary option is passed instead (e.g. { a: "abc" }), the request succeeds normally in Safari 26.2.
Steps to Reproduce
Start a simple local HTTP server:
Example: http://127.0.0.1:8080
Endpoint returns plain text via GET
Run the following code in Safari 26.2:
fetch('http://127.0.0.1:8080', {
targetAddressSpace: 'loopback'
})
.then(response => response.text())
.then(text => console.log(text))
.catch(error => console.error(error));
Expected Result
The request succeeds
Response text is logged to the console
Actual Result
The request immediately fails
catch is triggered with a TypeError
No network request is completed
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/166574523>
Ryosuke Niwa
This is because we don’t support “loopback” for IPAddressSpace:
https://wicg.github.io/local-network-access/#ip-address-space-section
Ryosuke Niwa
Pull request: https://github.com/WebKit/WebKit/pull/55516
EWS
Committed 304577@main (295fd224c10d): <https://commits.webkit.org/304577@main>
Reviewed commits have been landed. Closing PR #55516 and removing active labels.