Skip to content

Commit 07f04fc

Browse files
committed
Update client.py
1 parent 4d9a378 commit 07f04fc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

splunklib/client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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 #if path.endswith('/') else 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('/'):
786+
self.path = self.path if self.path != "" and path_segment.startswith('/') else 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('/'):
848+
self.path = self.path if self.path != "" and path_segment.startswith('/') else 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

Comments
 (0)