From 657f54c210792a229417c9fc38cc5bdc392763dd Mon Sep 17 00:00:00 2001 From: Jacopo Margutti Date: Fri, 6 Oct 2023 22:47:23 +0200 Subject: [PATCH] Update espo_api_client.py --- clients/espo_api_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clients/espo_api_client.py b/clients/espo_api_client.py index 52078d8..d8f5ac8 100644 --- a/clients/espo_api_client.py +++ b/clients/espo_api_client.py @@ -38,6 +38,8 @@ class EspoAPI: url_path = '/api/v1/' def __init__(self, url, api_key): + if url.endswith('/'): + url = url[:-1] self.url = url self.api_key = api_key self.status_code = None @@ -86,4 +88,4 @@ def parse_reason(headers): if 'X-Status-Reason' not in headers: return 'Unknown Error' - return headers['X-Status-Reason'] \ No newline at end of file + return headers['X-Status-Reason']