From 3622cbf0ee26341962646241ffd1ca5a7e0a3113 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Wed, 14 Jan 2026 16:45:27 -0600 Subject: [PATCH] Strip trailing slash from API URL to prevent double slashes Fixes issue where API URL like 'https://towerops.net/' would result in URLs like 'https://towerops.net//api/v1/agent/config' causing 406 errors. --- src/api_client.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/api_client.rs b/src/api_client.rs index 9f01afc..fb13e26 100644 --- a/src/api_client.rs +++ b/src/api_client.rs @@ -46,6 +46,8 @@ pub struct ApiClient { impl ApiClient { /// Create a new API client pub fn new(base_url: String, token: String) -> Result { + // Strip trailing slash from base_url to avoid double slashes in URLs + let base_url = base_url.trim_end_matches('/').to_string(); Ok(Self { base_url, token }) }