Opaque being-loaded responses should clone their body
[WebKit-https.git] / Source / WebCore / Modules / fetch / FetchResponse.cpp
index 2415e0bff561817dbc2b0cfd96fd14133035f5ef..5a3778da6608fe6ff8d40fd8bb683168814ab295 100644 (file)
@@ -167,8 +167,8 @@ ExceptionOr<Ref<FetchResponse>> FetchResponse::clone(ScriptExecutionContext& con
     ASSERT(scriptExecutionContext());
 
     // If loading, let's create a stream so that data is teed on both clones.
-    if (isLoading())
-        readableStream(*context.execState());
+    if (isLoading() && !m_readableStreamSource)
+        createReadableStream(*context.execState());
 
     // Synthetic responses do not store headers in m_internalResponse.
     if (m_internalResponse.type() == ResourceResponse::Type::Default)