From 38ea76f490a94b5734d4b39ca0c0be2e6ab6f90a Mon Sep 17 00:00:00 2001 From: jakka Date: Wed, 1 Oct 2025 14:30:07 +0300 Subject: implemented existing functions for sync client --- src/async_lib/client.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/async_lib/client.rs') 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 -- cgit v1.3.1