#36 Prevent duplicate slashes in URL
Merged 6 years ago by jkaluza. Opened 6 years ago by sochotni.
sochotni/freshmaker master  into  master

Prevent duplicate slashes in URL
Stanislav Ochotnicky • 6 years ago  
file modified
+2 -2
@@ -105,8 +105,8 @@ 

              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:

This removes a slash at the end of api_root. This was causing duplicate
slash when querying LB and LB throws 404 in those cases instead of
treating it identically

I would even .rstrip("/") the server_url to make sure that it won't cause some harm in the future.

rebased

6 years ago

Pull-Request has been merged by jkaluza

6 years ago