-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Communication] - Phone Numbers - Changed User-Agent in request #17162
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,14 +25,14 @@ def process_response(self, response): | |
if isinstance(item, str): | ||
body["phoneNumbers"] = [self._replacement] | ||
break | ||
elif "phoneNumber" in item: | ||
if "phoneNumber" in item: | ||
item['phoneNumber'] = self._replacement | ||
elif "id" in item: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why we change from elif to if here? |
||
if "id" in item: | ||
item['id'] = self._replacement | ||
response['body']['string'] = json.dumps(body) | ||
response['url'] = self._replacement | ||
return response | ||
except (KeyError, ValueError): | ||
except (KeyError, ValueError, TypeError): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why we need this change for the User-agent change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a fix for the type error issue we have in the search available phone numbers test. We weren't catching that exception before. It's totally unrelated to the user agent issue, though. |
||
return response | ||
|
||
class BodyReplacerProcessor(RecordingProcessor): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we change from elif to if here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to sanitize both values. Having an elif only sanitized the phone number or the id, but not both at the same time.