Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit 297ade8

Browse files
committed
didn't handle /a/:b/c correctly when /a existed
1 parent 9f61cbc commit 297ade8

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

CloudFlare/api_extras.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ def api_extras(self, extras=None):
88
extra = re.sub(r"^.*/client/v4/", '/', extra)
99
extra = re.sub(r"^.*/v4/", '/', extra)
1010
extra = re.sub(r"^/", '', extra)
11-
current = self
1211

1312
# build parts of the extra command
1413
parts = []
@@ -25,11 +24,15 @@ def api_extras(self, extras=None):
2524

2625
# insert extra command into class
2726
element_path = []
27+
current = self
2828
for element in parts[0]:
2929
element_path.append(element)
3030
try:
31-
current = getattr(current, element)
32-
# exists
31+
m = getattr(current, element)
32+
# exists - but still add it there's a second part
33+
if element == parts[0][-1] and len(parts) > 1:
34+
setattr(m, parts[1][0], self._client_with_auth(self.base, '/'.join(element_path), '/'.join(parts[1])))
35+
current = m
3336
continue
3437
except:
3538
pass

0 commit comments

Comments
 (0)