@@ -724,7 +724,7 @@ class Endpoint(object):
724724 """
725725 def __init__ (self , service , path ):
726726 self .service = service
727- self .path = path if path . endswith ( '/' ) else path + '/'
727+ self .path = path
728728
729729 def get (self , path_segment = "" , owner = None , app = None , sharing = None , ** query ):
730730 """Performs a GET operation on the path segment relative to this endpoint.
@@ -782,6 +782,8 @@ def get(self, path_segment="", owner=None, app=None, sharing=None, **query):
782782 if path_segment .startswith ('/' ):
783783 path = path_segment
784784 else :
785+ if not self .path .endswith ('/' ) and path_segment != "" :
786+ self .path = self .path + '/'
785787 path = self .service ._abspath (self .path + path_segment , owner = owner ,
786788 app = app , sharing = sharing )
787789 # ^-- This was "%s%s" % (self.path, path_segment).
@@ -842,6 +844,8 @@ def post(self, path_segment="", owner=None, app=None, sharing=None, **query):
842844 if path_segment .startswith ('/' ):
843845 path = path_segment
844846 else :
847+ if not self .path .endswith ('/' ) and path_segment != "" :
848+ self .path = self .path + '/'
845849 path = self .service ._abspath (self .path + path_segment , owner = owner , app = app , sharing = sharing )
846850 return self .service .post (path , owner = owner , app = app , sharing = sharing , ** query )
847851
0 commit comments