Implement the Fetch method

This commit is contained in:
Jeena Lee 2016-09-06 10:54:06 -07:00
parent a03a5e814a
commit 3216009731
213 changed files with 1208 additions and 1719 deletions

View file

@ -229,6 +229,10 @@ impl Headers {
*self.header_list.borrow_mut() = HyperHeaders::new();
}
pub fn set_headers(&self, hyper_headers: HyperHeaders) {
*self.header_list.borrow_mut() = hyper_headers;
}
// https://fetch.spec.whatwg.org/#concept-header-extract-mime-type
pub fn extract_mime_type(&self) -> Vec<u8> {
self.header_list.borrow().get_raw("content-type").map_or(vec![], |v| v[0].clone())