From f51678bc527d9fdb1fb5793b626d4551681c7324 Mon Sep 17 00:00:00 2001 From: Stanislav Ochotnicky Date: May 29 2017 12:28:57 +0000 Subject: Prevent duplicate slashes in URL This removes a slash at the end of api_root and also strips possible slash at the end of server_url. This was causing duplicate slash when querying LB and LB throws 404 in those cases instead of treating it identically --- diff --git a/freshmaker/lightblue.py b/freshmaker/lightblue.py index 0c881e4..abda908 100644 --- a/freshmaker/lightblue.py +++ b/freshmaker/lightblue.py @@ -105,8 +105,8 @@ class LightBlue(object): explicitly. If entity_versions is omitted entirely, default version will be used on each entity. """ - self.server_url = server_url - self.api_root = '{}/rest/data/'.format(server_url) + self.server_url = server_url.rstrip('/') + self.api_root = '{}/rest/data'.format(server_url) if verify_ssl is None: self.verify_ssl = True else: