aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/response.rs
diff options
context:
space:
mode:
authorAtte Lautanala <atte.lautanala@gmail.com>2016-10-22 18:37:36 +0300
committerAtte Lautanala <atte.lautanala@gmail.com>2016-10-23 12:32:48 +0300
commit65a774786444065eaa59a727e9c8851ef2bb40d5 (patch)
tree7248cf5cf758a6f89e97bae8a23916610267d43f /components/script/dom/response.rs
parent62689ba64deb5f0c93f2fe3dfd69258b21d2fb47 (diff)
downloadservo-65a774786444065eaa59a727e9c8851ef2bb40d5.tar.gz
servo-65a774786444065eaa59a727e9c8851ef2bb40d5.zip
Implement response API Clone step 1
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());