@@ -724,7 +724,7 @@ class Endpoint(object):
724
724
"""
725
725
def __init__ (self , service , path ):
726
726
self .service = service
727
- self .path = path if path . endswith ( '/' ) else path + '/'
727
+ self .path = path
728
728
729
729
def get (self , path_segment = "" , owner = None , app = None , sharing = None , ** query ):
730
730
"""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):
782
782
if path_segment .startswith ('/' ):
783
783
path = path_segment
784
784
else :
785
+ if not self .path .endswith ('/' ) and path_segment != "" :
786
+ self .path = self .path + '/'
785
787
path = self .service ._abspath (self .path + path_segment , owner = owner ,
786
788
app = app , sharing = sharing )
787
789
# ^-- This was "%s%s" % (self.path, path_segment).
@@ -842,6 +844,8 @@ def post(self, path_segment="", owner=None, app=None, sharing=None, **query):
842
844
if path_segment .startswith ('/' ):
843
845
path = path_segment
844
846
else :
847
+ if not self .path .endswith ('/' ) and path_segment != "" :
848
+ self .path = self .path + '/'
845
849
path = self .service ._abspath (self .path + path_segment , owner = owner , app = app , sharing = sharing )
846
850
return self .service .post (path , owner = owner , app = app , sharing = sharing , ** query )
847
851
0 commit comments