Commits

Anonymous committed d1f952c

fix trailing slash, make sure we keep it on base if no path behind

Comments (0)

Files changed (1)

restclient/rest.py

         string parameters.
 
         """
+        trailing_slash = False
         if base and base.endswith("/"):
+            trailing_slash = True
             base = base[:-1]
         retval = [base]
 
         path = "/".join([''] +
                         [url_quote(s.strip('/'), self.charset, self.safe) for s in path
                          if s is not None and isinstance(s, basestring)])
-
+                         
+        if trailing_slash and not path:
+            path = path + "/"
+            
         if path:
             retval.append(path)