From 02f7fc3632d43bd609d23daeda6130fc3e93043b Mon Sep 17 00:00:00 2001 From: Rauli Kaksonen <43605561+raulikak@users.noreply.github.com> Date: Thu, 2 May 2024 10:49:01 +0300 Subject: [PATCH] Complain with client tool URL ending with / --- tcsfw/client_tool.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tcsfw/client_tool.py b/tcsfw/client_tool.py index be5ff00..4dad830 100644 --- a/tcsfw/client_tool.py +++ b/tcsfw/client_tool.py @@ -274,6 +274,8 @@ def upload_file_data(self, url: str, temp_file: BinaryIO): def resolve_api_url(self, url: str) -> str: """Query server for API URL""" # split URL into host and statement + if url.endswith("/"): + raise ValueError("URL should not end with /") u = urlparse(url) base_url = f"{u.scheme}://{u.netloc}" path = urlunparse(('', '', u.path, u.params, u.query, u.fragment))