mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Use Url.join instead of UrlParser.base_url(...).parse (#9002)
This commit is contained in:
parent
6764cf0ee9
commit
11234f5370
41 changed files with 58 additions and 64 deletions
|
@ -39,5 +39,5 @@ mime_guess = "1.1.1"
|
|||
flate2 = "0.2.0"
|
||||
uuid = "0.1.16"
|
||||
euclid = {version = "0.4", features = ["plugins"]}
|
||||
url = "0.5"
|
||||
url = "0.5.2"
|
||||
websocket = "0.14.0"
|
||||
|
|
|
@ -17,7 +17,7 @@ use std::ascii::AsciiExt;
|
|||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
use std::str::FromStr;
|
||||
use url::{Url, UrlParser};
|
||||
use url::Url;
|
||||
use util::task::spawn_named;
|
||||
|
||||
/// A [request context](https://fetch.spec.whatwg.org/#concept-request-context)
|
||||
|
@ -367,7 +367,7 @@ impl Request {
|
|||
_ => return Response::network_error(),
|
||||
};
|
||||
// Step 5
|
||||
let location_url = UrlParser::new().base_url(self.url_list.last().unwrap()).parse(&*location);
|
||||
let location_url = self.url_list.last().unwrap().join(&*location);
|
||||
// Step 6
|
||||
let location_url = match location_url {
|
||||
Ok(ref url) if url.scheme == "data" => { return Response::network_error(); }
|
||||
|
|
|
@ -37,7 +37,7 @@ use std::error::Error;
|
|||
use std::io::{self, Read, Write};
|
||||
use std::sync::mpsc::Sender;
|
||||
use std::sync::{Arc, RwLock};
|
||||
use url::{Url, UrlParser};
|
||||
use url::Url;
|
||||
use util::resource_files::resources_dir_path;
|
||||
use util::task::spawn_named;
|
||||
use uuid;
|
||||
|
@ -700,7 +700,7 @@ pub fn load<A>(load_data: LoadData,
|
|||
}
|
||||
}
|
||||
|
||||
let new_doc_url = match UrlParser::new().base_url(&doc_url).parse(&new_url) {
|
||||
let new_doc_url = match doc_url.join(&new_url) {
|
||||
Ok(u) => u,
|
||||
Err(e) => {
|
||||
return Err(LoadError::InvalidRedirect(doc_url, e.to_string()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue