mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Adapt to net_url changes
This commit is contained in:
parent
cb85521097
commit
1651d7036b
1 changed files with 4 additions and 3 deletions
|
@ -13,9 +13,8 @@ Create a URL object from a string. Does various helpful browsery things like
|
||||||
|
|
||||||
*/
|
*/
|
||||||
fn make_url(str_url: ~str, current_url: option<url>) -> url {
|
fn make_url(str_url: ~str, current_url: option<url>) -> url {
|
||||||
let str_url = if get_scheme(str_url).is_some() {
|
let mut schm = get_scheme(str_url);
|
||||||
str_url
|
let str_url = if result::is_err(schm) {
|
||||||
} else {
|
|
||||||
if current_url.is_none() {
|
if current_url.is_none() {
|
||||||
// If all we have is a filename, assume it's a local relative file
|
// If all we have is a filename, assume it's a local relative file
|
||||||
// and build an absolute path with the cwd
|
// and build an absolute path with the cwd
|
||||||
|
@ -33,6 +32,8 @@ fn make_url(str_url: ~str, current_url: option<url>) -> url {
|
||||||
current_url.scheme + "://" + path::connect(current_url.host, path)
|
current_url.scheme + "://" + path::connect(current_url.host, path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
str_url
|
||||||
};
|
};
|
||||||
|
|
||||||
// FIXME: Need to handle errors
|
// FIXME: Need to handle errors
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue