aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_task.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/script_task.rs')
-rw-r--r--components/script/script_task.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/components/script/script_task.rs b/components/script/script_task.rs
index ec4b40bfc75..877289a27fd 100644
--- a/components/script/script_task.rs
+++ b/components/script/script_task.rs
@@ -83,7 +83,6 @@ use js;
use url::Url;
use libc;
-use std::ascii::AsciiExt;
use std::any::Any;
use std::borrow::ToOwned;
use std::cell::{Cell, RefCell};
@@ -96,6 +95,9 @@ use std::result::Result;
use std::sync::mpsc::{channel, Sender, Receiver, Select};
use time::Tm;
+use hyper::header::ContentType;
+use hyper::mime::{Mime, TopLevel, SubLevel};
+
thread_local!(pub static STACK_ROOTS: Cell<Option<RootCollectionPtr>> = Cell::new(None));
thread_local!(static SCRIPT_TASK_ROOT: RefCell<Option<*const ScriptTask>> = RefCell::new(None));
@@ -1052,10 +1054,7 @@ impl ScriptTask {
});
let content_type = match response.metadata.content_type {
- Some((ref t, ref st)) if t.as_slice().eq_ignore_ascii_case("text") &&
- st.as_slice().eq_ignore_ascii_case("plain") => {
- Some("text/plain".to_owned())
- }
+ Some(ContentType(Mime(TopLevel::Text, SubLevel::Plain, _))) => Some("text/plain".to_owned()),
_ => None
};