From 45960b89d67bb2cb15d496d043830c25317f2b32 Mon Sep 17 00:00:00 2001
From: Timm Fitschen <t.fitschen@indiscale.com>
Date: Thu, 3 Nov 2022 11:53:52 +0100
Subject: [PATCH] WIP: http proxy

---
 src/caosdb/connection/connection.py | 3 +++
 src/caosdb/connection/utils.py      | 5 +----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/caosdb/connection/connection.py b/src/caosdb/connection/connection.py
index 4cd8bc77..99cb7431 100644
--- a/src/caosdb/connection/connection.py
+++ b/src/caosdb/connection/connection.py
@@ -143,6 +143,9 @@ class _DefaultCaosDBServerConnection(CaosDBServerConnection):
             headers = {}
         headers["User-Agent"] = self._useragent
 
+        if path.endswith("/."):
+            path = path[:-1] + "%2E"
+
         try:
             response = self._session.request(
                 method=method,
diff --git a/src/caosdb/connection/utils.py b/src/caosdb/connection/utils.py
index 6d0b7a8b..9056bf9d 100644
--- a/src/caosdb/connection/utils.py
+++ b/src/caosdb/connection/utils.py
@@ -102,16 +102,13 @@ def make_uri_path(segments=None, query=None):
     """
     path_no_query = ("/".join([quote(segment) for segment in segments])
                      if segments else "")
-    result = str(path_no_query if query is None else "?".join([
+    return str(path_no_query if query is None else "?".join([
         path_no_query, "&".join([
             quote(key) + "=" +
             (quote(query[key]) if query[key] is not None else "")
             for key in query
         ])
     ]))
-    if result.endswith("/."):
-        result = result[:-1] + "%2E"
-    return result
 
 
 def quote(string):
-- 
GitLab