Make sure aiohttp web response body is a binary#199
Draft
oavdeev wants to merge 1 commit intoNetflix:masterfrom
Draft
Make sure aiohttp web response body is a binary#199oavdeev wants to merge 1 commit intoNetflix:masterfrom
oavdeev wants to merge 1 commit intoNetflix:masterfrom
Conversation
oavdeev
commented
Jul 7, 2021
| elif isinstance(exception, IndexError): | ||
| return DBResponse(response_code=404, body={}) | ||
| else: | ||
| return DBResponse(response_code=500, body=json.dumps(body)) |
Collaborator
Author
There was a problem hiding this comment.
Unless I'm missing something, before this fix body was doubly-encoded here and at https://github.com/Netflix/metaflow-service/blob/master/services/metadata_service/api/utils.py#L24
Contributor
There was a problem hiding this comment.
This is somewhat duplicative of #184 (or the idea is for that to be the cleanup PR). I need to change things in the client too and we need to support both ways of doing things. But yes, this is planned.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If you look at aiohttp docs, body is supposed to be a binary, not string. It mostly works if you pass a string, however some auxiliary things break -- I've ran into some issues because of this while trying to use
aiohttp-devel.