Skip to content
This repository was archived by the owner on Jun 13, 2023. It is now read-only.

fix(tornado.py): fix response parsing#315

Closed
ranrib wants to merge 2 commits intomasterfrom
tornado-fix
Closed

fix(tornado.py): fix response parsing#315
ranrib wants to merge 2 commits intomasterfrom
tornado-fix

Conversation

@ranrib
Copy link
Copy Markdown
Contributor

@ranrib ranrib commented Jan 10, 2021

No description provided.

@ranrib ranrib self-assigned this Jan 10, 2021
@ranrib ranrib requested a review from a team as a code owner January 10, 2021 13:36
@ranrib ranrib requested a review from adavidai January 10, 2021 13:36

if response_body:
if isinstance(response_body, list):
response_body = response_body[0]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible that the passed response_body is the actual response that the user uses?
Could be a good idea to use a different var and not change the response_body itself

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also handle empty list use case

if isinstance(response_body, list):
response_body = response_body[0]
if isinstance(response_body, bytes):
response_body = response_body.decode('utf-8')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

@ranrib ranrib closed this Jan 12, 2021
@ranrib
Copy link
Copy Markdown
Contributor Author

ranrib commented Jan 12, 2021

Addressed in #317

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants