mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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())
|
||||
|
|
|
@ -339,6 +339,9 @@ impl Request {
|
|||
_ => {},
|
||||
}
|
||||
|
||||
// Copy the headers list onto the headers of net_traits::Request
|
||||
r.request.borrow_mut().headers = r.Headers().get_headers_list();
|
||||
|
||||
// Step 32
|
||||
let mut input_body = if let RequestInfo::Request(ref input_request) = input {
|
||||
let input_request_request = input_request.request.borrow();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue