Remove default URL_BASE of localhost.

This commit is contained in:
Jacob Hoffman-Andrews
2020-07-02 23:01:51 -07:00
parent 6e69f6cf69
commit b53de7a7ed

View File

@@ -2,7 +2,6 @@ use std::io::Read;
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use std::time; use std::time;
use lazy_static::lazy_static;
use qstring::QString; use qstring::QString;
use url::{form_urlencoded, Url}; use url::{form_urlencoded, Url};
@@ -20,10 +19,6 @@ use crate::Response;
#[cfg(feature = "json")] #[cfg(feature = "json")]
use super::SerdeValue; use super::SerdeValue;
lazy_static! {
static ref URL_BASE: Url = Url::parse("http://localhost/").expect("Failed to parse URL_BASE");
}
/// Request instances are builders that creates a request. /// Request instances are builders that creates a request.
/// ///
/// ``` /// ```
@@ -571,9 +566,7 @@ impl Request {
} }
fn to_url(&self) -> Result<Url, Error> { fn to_url(&self) -> Result<Url, Error> {
URL_BASE Url::parse(&self.url).map_err(|e| Error::BadUrl(format!("{}", e)))
.join(&self.url)
.map_err(|e| Error::BadUrl(format!("{}", e)))
} }
/// Set the proxy server to use for the connection. /// Set the proxy server to use for the connection.