Partial implementation of Main Fetch step, including appropiate updates to tests

This commit is contained in:
Nikki 2016-01-21 15:52:51 -07:00
parent 842ec7c415
commit db8cc6eccf
6 changed files with 264 additions and 65 deletions

View file

@ -11,7 +11,7 @@ use std::rc::Rc;
use url::Url;
/// [Response type](https://fetch.spec.whatwg.org/#concept-response-type)
#[derive(Clone, PartialEq, Copy)]
#[derive(Clone, PartialEq, Copy, Debug)]
pub enum ResponseType {
Basic,
CORS,
@ -71,7 +71,7 @@ pub struct Response {
/// `None` can be considered a StatusCode of `0`.
pub status: Option<StatusCode>,
pub headers: Headers,
pub body: ResponseBody,
pub body: RefCell<ResponseBody>,
pub cache_state: CacheState,
pub https_state: HttpsState,
/// [Internal response](https://fetch.spec.whatwg.org/#concept-internal-response), only used if the Response
@ -88,7 +88,7 @@ impl Response {
url_list: RefCell::new(vec![]),
status: None,
headers: Headers::new(),
body: ResponseBody::Empty,
body: RefCell::new(ResponseBody::Empty),
cache_state: CacheState::None,
https_state: HttpsState::None,
internal_response: None