Enable binary responses in the http-templates#39
Merged
Conversation
Member
Author
|
Also tested subsequently when setting no headers. |
alexellis
commented
Jul 24, 2020
| class Context: | ||
| def __init__(self): | ||
| self.hostname = os.getenv('HOSTNAME', 'localhost') | ||
| self.hostname = os.environ['HOSTNAME'] |
Member
Author
There was a problem hiding this comment.
This wasn't intended, let me revert that.
This was not possible previously, and resulted in a byte array being converted to a string and creating an invalid file. To opt in, set the content type appropriately as: application/octet-stream. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
1b022a3 to
cbb89fb
Compare
mehyedes
approved these changes
Jul 24, 2020
mehyedes
left a comment
Contributor
There was a problem hiding this comment.
LGTM.
Are you planning to apply the same changes to python3-http as well ?
Member
Author
|
Thank you for looking. That is a good point,I felt like I'd missed something obvious. |
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.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) alexellis2@gmail.com
Description
Enable binary responses in the http-templates
Motivation and Context
This was not possible previously, and resulted in a byte array
being converted to a string and creating an invalid file.
To opt in, set the content type appropriately as:
application/octet-stream.
How Has This Been Tested?
Before / after - one created a lot of serialised bytes and the after I got an image.