aboutsummaryrefslogtreecommitdiffstats
path: root/components/net/fetch/response.rs
diff options
context:
space:
mode:
authorKeith Yeung <kungfukeith11@gmail.com>2015-11-11 21:00:25 -0800
committerKeith Yeung <kungfukeith11@gmail.com>2015-11-26 17:12:19 -0800
commit7d3eb72a266bf8c21415e04cde53fc0af77fc921 (patch)
tree5273832f4e51a31600638e7a2c23b8c23fda48e6 /components/net/fetch/response.rs
parent7623e895064843f33a0cd93080001480113cb20a (diff)
downloadservo-7d3eb72a266bf8c21415e04cde53fc0af77fc921.tar.gz
servo-7d3eb72a266bf8c21415e04cde53fc0af77fc921.zip
Refactor http_fetch to reflect the new standard
Diffstat (limited to 'components/net/fetch/response.rs')
-rw-r--r--components/net/fetch/response.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/components/net/fetch/response.rs b/components/net/fetch/response.rs
index fe39e1495c0..584e6e7fe40 100644
--- a/components/net/fetch/response.rs
+++ b/components/net/fetch/response.rs
@@ -6,6 +6,8 @@ use hyper::header::Headers;
use hyper::status::StatusCode;
use net_traits::{Response, ResponseBody, ResponseType};
use std::ascii::AsciiExt;
+use std::cell::RefCell;
+use std::rc::Rc;
use std::sync::mpsc::Receiver;
use url::Url;
@@ -20,6 +22,7 @@ impl ResponseMethods for Response {
response_type: ResponseType::Default,
termination_reason: None,
url: None,
+ url_list: Vec::new(),
status: Some(StatusCode::Ok),
headers: Headers::new(),
body: ResponseBody::Empty,
@@ -37,7 +40,7 @@ impl ResponseMethods for Response {
}
let old_headers = self.headers.clone();
let mut response = self.clone();
- response.internal_response = Some(box self);
+ response.internal_response = Some(Rc::new(RefCell::new(self)));
match filter_type {
ResponseType::Default | ResponseType::Error => unreachable!(),
ResponseType::Basic => {
@@ -62,7 +65,8 @@ impl ResponseMethods for Response {
response.headers = headers;
response.response_type = filter_type;
},
- ResponseType::Opaque => {
+ ResponseType::Opaque |
+ ResponseType::OpaqueRedirect => {
response.headers = Headers::new();
response.status = None;
response.body = ResponseBody::Empty;