aboutsummaryrefslogtreecommitdiffstats
path: root/components/net/fetch/methods.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <ecoal95@gmail.com>2016-11-16 11:57:39 +0100
committerEmilio Cobos Álvarez <ecoal95@gmail.com>2016-11-17 18:34:23 +0100
commit913c874cb55fd0fdc9e8f3a4c34624cd015fac8a (patch)
tree4526ecefafe0cde2f56cb1e2a4ebffd372e1f70a /components/net/fetch/methods.rs
parentf14e7339b5ff95fce0127dce4fe87ce082ab7259 (diff)
downloadservo-913c874cb55fd0fdc9e8f3a4c34624cd015fac8a.tar.gz
servo-913c874cb55fd0fdc9e8f3a4c34624cd015fac8a.zip
Urlmageddon: Use refcounted urls more often.
Diffstat (limited to 'components/net/fetch/methods.rs')
-rw-r--r--components/net/fetch/methods.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/components/net/fetch/methods.rs b/components/net/fetch/methods.rs
index 5a98f969b81..82bfd0f7c1d 100644
--- a/components/net/fetch/methods.rs
+++ b/components/net/fetch/methods.rs
@@ -29,6 +29,7 @@ use net_traits::request::{RedirectMode, Referrer, Request, RequestMode, Response
use net_traits::request::{Type, Origin, Window};
use net_traits::response::{HttpsState, Response, ResponseBody, ResponseType};
use resource_thread::CancellationListener;
+use servo_url::ServoUrl;
use std::borrow::Cow;
use std::collections::HashSet;
use std::error::Error;
@@ -40,7 +41,7 @@ use std::ops::Deref;
use std::rc::Rc;
use std::sync::mpsc::{channel, Sender, Receiver};
use unicase::UniCase;
-use url::{Origin as UrlOrigin, Url};
+use url::{Origin as UrlOrigin};
use util::thread::spawn_named;
use uuid;
@@ -1305,7 +1306,7 @@ fn cors_check(request: Rc<Request>, response: &Response) -> Result<(), ()> {
Err(())
}
-fn has_credentials(url: &Url) -> bool {
+fn has_credentials(url: &ServoUrl) -> bool {
!url.username().is_empty() || url.password().is_some()
}