mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +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
|
// https://fetch.spec.whatwg.org/#dom-response-clone
|
||||||
fn Clone(&self) -> Fallible<Root<Response>> {
|
fn Clone(&self) -> Fallible<Root<Response>> {
|
||||||
// Step 1
|
// 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
|
// Step 2
|
||||||
let new_response = Response::new(&self.global());
|
let new_response = Response::new(&self.global());
|
||||||
|
|
|
@ -6,9 +6,6 @@
|
||||||
[Check cloned response's body]
|
[Check cloned response's body]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Cannot clone a disturbed response]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Cloned responses should provide the same data]
|
[Cloned responses should provide the same data]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue