diff options
Diffstat (limited to 'src/async_lib')
| -rw-r--r-- | src/async_lib/client.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/async_lib/client.rs b/src/async_lib/client.rs index 51ed963..784f269 100644 --- a/src/async_lib/client.rs +++ b/src/async_lib/client.rs @@ -20,13 +20,17 @@ pub struct HydrusClient { } impl HydrusClient { - /// create a new hydurs client object. requires a url to hydrus API endpoint + /// create a new hydrus client object. requires a hydrus API endpoint url pub fn new(url: &str) -> HydrusClient { + let mut url = url.to_string(); + if !url.ends_with('/') { + url.push('/'); + } HydrusClient { client: reqwest::Client::new(), apikey: None, sessionkey: None, - url: url.to_string(), + url, } } /// set an api key |
