aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/headers.rs
diff options
context:
space:
mode:
authorGregory Terzian <gterzian@users.noreply.github.com>2017-11-12 14:11:50 +0800
committerGregory Terzian <gterzian@users.noreply.github.com>2017-11-15 19:28:03 +0800
commitd196f3de621770ecf38a6349bc8cd00c0aa7aa07 (patch)
treec9adbd2c57d840eb4938045c97baadc5a2988ad9 /components/script/dom/headers.rs
parentf674cba6125cecddc9a54182f66963238b5bdee1 (diff)
downloadservo-d196f3de621770ecf38a6349bc8cd00c0aa7aa07.tar.gz
servo-d196f3de621770ecf38a6349bc8cd00c0aa7aa07.zip
copy headers from script request to net request
Diffstat (limited to 'components/script/dom/headers.rs')
-rw-r--r--components/script/dom/headers.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/components/script/dom/headers.rs b/components/script/dom/headers.rs
index 5d152ab93bb..b351e2b7f13 100644
--- a/components/script/dom/headers.rs
+++ b/components/script/dom/headers.rs
@@ -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())