Skip to content

Commit 3ff30ad

Browse files
Clone response in Lookup Race Response algorithm (#1811)
The "Lookup Race Response" algorithm returned a response from the race response map directly. This could lead to issues where a response body is consumed more than once, as a Response object's body cannot be reused across multiple fetch operations. This change modifies the algorithm to return a clone of the response, aligning with the Fetch specification's standard practice for handling responses that may be used by multiple consumers. This ensures that each fetch handler receives a distinct, readable stream. See also: https://fetch.spec.whatwg.org/#concept-response-clone
1 parent a6ed7c8 commit 3ff30ad

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

index.bs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4158,7 +4158,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
41584158
1. If |map|[|request|] [=map/exists=], then:
41594159
1. Let |entry| be |map|[|request|].
41604160
1. Wait until |entry|'s [=race response/value=] is not "<code>pending</code>"
4161-
1. If |entry|'s [=race response/value=] is [=/response=], return |entry|'s [=race response/value=].
4161+
1. If |entry|'s [=race response/value=] is a [=/response=], return the result of <a for="response">cloning</a> |entry|'s [=race response/value=].
41624162
1. Return null.
41634163
</section>
41644164
</section>

0 commit comments

Comments
 (0)