Skip to content

Commit 295fd22

Browse files
committed
REGRESSION (298981@main): fetch() throws TypeError when using targetAddressSpace: 'loopback' with localhost requests
https://bugs.webkit.org/show_bug.cgi?id=304164 rdar://166574523 Reviewed by Alex Christensen. Hide the dictionary entry behind a runtime check since this feature (IPAddressSpace) shouldn't be enabled anywhere. Test: http/wpt/fetch/fetch-loopback.html * LayoutTests/http/wpt/fetch/fetch-loopback-expected.txt: Added. * LayoutTests/http/wpt/fetch/fetch-loopback.html: Added. * Source/WebCore/Modules/fetch/FetchRequestInit.idl: Canonical link: https://commits.webkit.org/304577@main
1 parent a52d14e commit 295fd22

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
PASS fetch with targetAddressSpace set to "loopback" should succeed
3+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<body>
4+
<script src=/resources/testharness.js></script>
5+
<script src=/resources/testharnessreport.js></script>
6+
<script>
7+
8+
promise_test((t) => {
9+
return fetch(location.origin + '/resources/gc.js', {
10+
targetAddressSpace: 'loopback'
11+
});
12+
}, 'fetch with targetAddressSpace set to "loopback" should succeed');
13+
14+
</script>
15+
</body>
16+
</html>

Source/WebCore/Modules/fetch/FetchRequestInit.idl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ dictionary FetchRequestInit {
4343
any signal;
4444
RequestPriority priority;
4545
any window; // can only be set to null
46-
IPAddressSpace targetAddressSpace;
46+
[EnabledBySetting=LocalNetworkAccessEnabled] IPAddressSpace targetAddressSpace;
4747
};

0 commit comments

Comments
 (0)