Index: third_party/WebKit/Source/modules/fetch/Response.cpp |
diff --git a/third_party/WebKit/Source/modules/fetch/Response.cpp b/third_party/WebKit/Source/modules/fetch/Response.cpp |
index a7d2421779c49e3e92b48b318430457c06533cd1..7ca6de459e0389fae07f31b3ad6a1c8f7836fc7d 100644 |
--- a/third_party/WebKit/Source/modules/fetch/Response.cpp |
+++ b/third_party/WebKit/Source/modules/fetch/Response.cpp |
@@ -339,7 +339,7 @@ Headers* Response::headers() const |
Response* Response::clone(ExceptionState& exceptionState) |
{ |
- if (bodyUsed()) { |
+ if (isBodyLocked() || bodyUsed()) { |
exceptionState.throwTypeError("Response body is already used"); |
return nullptr; |
} |
@@ -390,6 +390,11 @@ bool Response::hasBody() const |
return m_response->internalBuffer(); |
} |
+bool Response::bodyUsed() |
+{ |
+ return internalBodyBuffer() && internalBodyBuffer()->stream()->isDisturbed(); |
+} |
+ |
String Response::mimeType() const |
{ |
return m_response->mimeType(); |