Skip to content

Commit

Permalink
replace response urls too (Azure#18758)
Browse files Browse the repository at this point in the history
  • Loading branch information
seankane-msft authored May 19, 2021
1 parent 890a9e4 commit 87d7dc5
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ def process_response(self, response):
self.replace_header_fn(response, 'location', self._replace_subscription_id)
self.replace_header_fn(response, 'azure-asyncoperation', self._replace_subscription_id)

try:
response["url"] = self._replace_subscription_id(response["url"])
except KeyError:
pass

return response

def _replace_subscription_id(self, val):
Expand Down Expand Up @@ -221,6 +226,11 @@ def process_response(self, response):
self.replace_header(response, 'operation-location', old, new)
self.replace_header(response, 'azure-asyncoperation', old, new)

try:
response["url"] = response["url"].replace(old, new)
except KeyError:
pass

return response


Expand Down

0 comments on commit 87d7dc5

Please sign in to comment.