diff --git a/components/net/resource_task.rs b/components/net/resource_task.rs
index 60ad9c8578b..0c473d42676 100644
--- a/components/net/resource_task.rs
+++ b/components/net/resource_task.rs
@@ -221,7 +221,7 @@ impl ResourceManager {
fn load(&self, load_data: LoadData) {
let mut load_data = load_data;
- self.user_agent.map(|ref ua| load_data.headers.set(UserAgent(ua.clone())));
+ self.user_agent.as_ref().map(|ua| load_data.headers.set(UserAgent(ua.clone())));
let senders = ResponseSenders {
immediate_consumer: self.sniffer_task.clone(),
eventual_consumer: load_data.consumer.clone(),
diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml
index f2adbed80c1..667aa76d7f9 100644
--- a/components/script/Cargo.toml
+++ b/components/script/Cargo.toml
@@ -52,8 +52,8 @@ branch = "servo"
[dependencies.encoding]
git = "https://github.com/lifthrasiir/rust-encoding"
-[dependencies.http]
-git = "https://github.com/servo/rust-http"
+[dependencies.hyper]
+git = "https://github.com/hyperium/hyper"
branch = "servo"
[dependencies.js]
diff --git a/components/script/cors.rs b/components/script/cors.rs
index 50e69ca333f..abd99af36d2 100644
--- a/components/script/cors.rs
+++ b/components/script/cors.rs
@@ -9,23 +9,21 @@
//! This library will eventually become the core of the Fetch crate
//! with CORSRequest being expanded into FetchRequest (etc)
-use std::ascii::{AsciiExt, OwnedAsciiExt};
-use std::from_str::FromStr;
-use std::io::BufReader;
+use std::ascii::AsciiExt;
+use std::fmt::{mod, Show};
+use std::str::from_utf8;
use time;
use time::{now, Timespec};
-use http::headers::response::HeaderCollection as ResponseHeaderCollection;
-use http::headers::request::HeaderCollection as RequestHeaderCollection;
-use http::headers::request::Header as RequestHeader;
+use hyper::header::{Headers, Header, HeaderFormat, HeaderView};
+use hyper::header::common::util as header_util;
+use hyper::client::Request;
+use hyper::mime::{mod, Mime};
+use hyper::header::common::{ContentType, Host};
+use hyper::method::{Method, Get, Head, Post, Options};
+use hyper::status::Success;
-use http::client::{RequestWriter, NetworkStream};
-use http::headers::{HeaderConvertible, HeaderEnum, HeaderValueByteIterator};
-use http::headers::content_type::MediaType;
-use http::headers::request::{Accept, AcceptLanguage, ContentLanguage, ContentType};
-use http::method::{Method, Get, Head, Post, Options};
-
-use url::{RelativeSchemeData, Url, UrlParser};
+use url::{RelativeSchemeData, Url};
#[deriving(Clone)]
pub struct CORSRequest {
@@ -33,7 +31,7 @@ pub struct CORSRequest {
pub destination: Url,
pub mode: RequestMode,
pub method: Method,
- pub headers: RequestHeaderCollection,
+ pub headers: Headers,
/// CORS preflight flag (http://fetch.spec.whatwg.org/#concept-http-fetch)
/// Indicates that a CORS preflight request and/or cache check is to be performed
pub preflight_flag: bool
@@ -51,7 +49,7 @@ pub enum RequestMode {
impl CORSRequest {
/// Creates a CORS request if necessary. Will return an error when fetching is forbidden
pub fn maybe_new(referer: Url, destination: Url, mode: RequestMode,
- method: Method, headers: RequestHeaderCollection) -> Result