mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Implement response API Clone step 1
This commit is contained in:
parent
62689ba64d
commit
65a7747864
2 changed files with 3 additions and 4 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue