mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Fix Request's Headers to be cloned correctly
Previously, when `Clone()` was called, Headers of the template Request did not get cloned properly. This commit fixes that issue, and updates the expected wpt results.
This commit is contained in:
parent
f4cb87a783
commit
d03167d980
2 changed files with 4 additions and 11 deletions
|
@ -420,7 +420,7 @@ impl Request {
|
|||
r
|
||||
}
|
||||
|
||||
fn clone_from(r: &Request) -> Root<Request> {
|
||||
fn clone_from(r: &Request) -> Fallible<Root<Request>> {
|
||||
let req = r.request.borrow();
|
||||
let url = req.url();
|
||||
let is_service_worker_global_scope = req.is_service_worker_global_scope;
|
||||
|
@ -436,8 +436,9 @@ impl Request {
|
|||
*r_clone.request.borrow_mut() = req.clone();
|
||||
r_clone.body_used.set(body_used);
|
||||
*r_clone.mime_type.borrow_mut() = mime_type;
|
||||
try!(r_clone.Headers().fill(Some(HeadersInit::Headers(r.Headers()))));
|
||||
r_clone.Headers().set_guard(headers_guard);
|
||||
r_clone
|
||||
Ok(r_clone)
|
||||
}
|
||||
|
||||
pub fn get_request(&self) -> NetTraitsRequest {
|
||||
|
@ -613,7 +614,7 @@ impl RequestMethods for Request {
|
|||
}
|
||||
|
||||
// Step 2
|
||||
Ok(Request::clone_from(self))
|
||||
Request::clone_from(self)
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
[request-clone.sub.html]
|
||||
type: testharness
|
||||
[Check cloning a request]
|
||||
expected: FAIL
|
||||
|
||||
[Check cloning a request copies the headers]
|
||||
expected: FAIL
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue