Skip to content

Commit bc3f043

Browse files
committed
fix overwriting host
1 parent 62cec69 commit bc3f043

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

splunk_sdk/auth/auth_manager.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -193,30 +193,30 @@ def _post(self, url, auth=None, headers=None, data=None, cookies=None):
193193
return response
194194

195195
def _url(self, path):
196+
scopedHost = self._host
196197
if self._tenant_scoped is True:
197198
if self._tenant is None:
198199
raise ValueError("Tenant is empty.")
199200
elif self._region is None:
200201
raise ValueError("Region is empty.")
201202
elif "token" in path and self._tenant != "system":
202-
self._host = self._tenant + "." + self._host
203+
scopedHost = self._tenant + "." + self._host
203204
# generate tenant scoped token
204205
path = "/" + self._tenant + path
205206
elif "token" in path and self._tenant == "system":
206-
self._host = "region-" + self._region + "." + self._host
207+
scopedHost = "region-" + self._region + "." + self._host
207208
# generate system scoped token
208209
path = "/system" + path
209210
elif "authorize" in path and self._tenant != "system":
210-
self._host = self._tenant + "." + self._host
211+
scopedHost = self._tenant + "." + self._host
211212
elif "authorize" in path and self._tenant == "system":
212-
self._host = "region-" + self._region + "." + self._host
213+
scopedHost = "region-" + self._region + "." + self._host
213214
elif "csrfToken" in path:
214-
self._host = "region-" + self._region + "." + self._host
215+
scopedHost = "region-" + self._region + "." + self._host
215216
elif "authn" in path:
216-
self._host = "region-" + self._region + "." + self._host
217-
218-
print("https://%s%s" % (self._host, path))
219-
return "https://%s%s" % (self._host, path)
217+
scopedHost = "region-" + self._region + "." + self._host
218+
print("https://%s%s" % (scopedHost, path))
219+
return "https://%s%s" % (scopedHost, path)
220220

221221
@staticmethod
222222
def _parse_querystring(url):

0 commit comments

Comments
 (0)