aboutsummaryrefslogtreecommitdiffstats
path: root/components/net/fetch
diff options
context:
space:
mode:
Diffstat (limited to 'components/net/fetch')
-rw-r--r--components/net/fetch/cors_cache.rs6
-rw-r--r--components/net/fetch/request.rs4
-rw-r--r--components/net/fetch/response.rs4
3 files changed, 7 insertions, 7 deletions
diff --git a/components/net/fetch/cors_cache.rs b/components/net/fetch/cors_cache.rs
index e3b79b48c24..5a36026fdc3 100644
--- a/components/net/fetch/cors_cache.rs
+++ b/components/net/fetch/cors_cache.rs
@@ -28,7 +28,7 @@ pub enum HeaderOrMethod {
impl HeaderOrMethod {
fn match_header(&self, header_name: &str) -> bool {
match *self {
- HeaderOrMethod::HeaderData(ref s) => s.as_slice().eq_ignore_ascii_case(header_name),
+ HeaderOrMethod::HeaderData(ref s) => s.eq_ignore_ascii_case(header_name),
_ => false
}
}
@@ -294,10 +294,10 @@ impl CORSCacheTask {
tx.send(());
},
CORSCacheTaskMsg::MatchHeader(request, header, tx) => {
- tx.send(self.cache.match_header(request, header.as_slice()));
+ tx.send(self.cache.match_header(request, &header));
},
CORSCacheTaskMsg::MatchHeaderUpdate(request, header, new_max_age, tx) => {
- tx.send(self.cache.match_header_and_update(request, header.as_slice(), new_max_age));
+ tx.send(self.cache.match_header_and_update(request, &header, new_max_age));
},
CORSCacheTaskMsg::MatchMethod(request, method, tx) => {
tx.send(self.cache.match_method(request, method));
diff --git a/components/net/fetch/request.rs b/components/net/fetch/request.rs
index 7134b054e98..e7bb5914aaa 100644
--- a/components/net/fetch/request.rs
+++ b/components/net/fetch/request.rs
@@ -119,9 +119,9 @@ impl Request {
/// [Basic fetch](http://fetch.spec.whatwg.org#basic-fetch)
pub fn basic_fetch(&mut self) -> Response {
- match self.url.scheme.as_slice() {
+ match &*self.url.scheme {
"about" => match self.url.non_relative_scheme_data() {
- Some(s) if s.as_slice() == "blank" => {
+ Some(s) if &*s == "blank" => {
let mut response = Response::new();
response.headers.set(ContentType(Mime(
TopLevel::Text, SubLevel::Html,
diff --git a/components/net/fetch/response.rs b/components/net/fetch/response.rs
index 7380f3e7ad6..1db7dce330c 100644
--- a/components/net/fetch/response.rs
+++ b/components/net/fetch/response.rs
@@ -110,7 +110,7 @@ impl Response {
ResponseType::Default | ResponseType::Error => unreachable!(),
ResponseType::Basic => {
let headers = old_headers.iter().filter(|header| {
- match header.name().to_ascii_lowercase().as_slice() {
+ match &*header.name().to_ascii_lowercase() {
"set-cookie" | "set-cookie2" => false,
_ => true
}
@@ -120,7 +120,7 @@ impl Response {
},
ResponseType::CORS => {
let headers = old_headers.iter().filter(|header| {
- match header.name().to_ascii_lowercase().as_slice() {
+ match &*header.name().to_ascii_lowercase() {
"cache-control" | "content-language" |
"content-type" | "expires" | "last-modified" | "Pragma" => false,
// XXXManishearth handle Access-Control-Expose-Headers