aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/response.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/response.rs')
-rw-r--r--components/script/dom/response.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/components/script/dom/response.rs b/components/script/dom/response.rs
index a1226204418..7607cacc972 100644
--- a/components/script/dom/response.rs
+++ b/components/script/dom/response.rs
@@ -298,7 +298,9 @@ impl ResponseMethods for Response {
// https://fetch.spec.whatwg.org/#dom-response-clone
fn Clone(&self) -> Fallible<Root<Response>> {
// Step 1
- // TODO: This step relies on body and stream, which are still unimplemented.
+ if self.is_locked() || self.body_used.get() {
+ return Err(Error::Type("cannot clone a disturbed response".to_string()));
+ }
// Step 2
let new_response = Response::new(&self.global());