mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
copy headers from script request to net request
This commit is contained in:
parent
f674cba612
commit
d196f3de62
7 changed files with 9 additions and 249 deletions
|
@ -234,6 +234,12 @@ impl Headers {
|
|||
*self.header_list.borrow_mut() = hyper_headers;
|
||||
}
|
||||
|
||||
pub fn get_headers_list(&self) -> HyperHeaders {
|
||||
let mut headers = HyperHeaders::new();
|
||||
headers.extend(self.header_list.borrow_mut().iter());
|
||||
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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue