summaryrefslogtreecommitdiff
path: root/src/async_lib
diff options
context:
space:
mode:
authorjakka <jakka@jakka.su>2025-10-01 14:30:07 +0300
committerjakka <jakka@jakka.su>2025-10-01 14:30:07 +0300
commit38ea76f490a94b5734d4b39ca0c0be2e6ab6f90a (patch)
tree2fced4196723cba4e9a6dcd0d8b02af49c293c6e /src/async_lib
parent8680fbc0fab62e47a7736e5194badba84411ea7f (diff)
implemented existing functions for sync client
Diffstat (limited to 'src/async_lib')
-rw-r--r--src/async_lib/client.rs8
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