Created
January 29, 2019 07:34
-
-
Save marcoleong/c6754672f39424afa14af9179175e575 to your computer and use it in GitHub Desktop.
Kubeless Python Botte response binary file
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
from bottle import abort, HTTPResponse | |
def handle(data, event): | |
headers = dict() | |
content = # binary content | |
headers['Content-Type'] = 'image/jpeg' | |
headers['Content-Disposition'] = 'inline' | |
headers['Content-Length'] = len(content) | |
headers['Etag'] = response.headers['Etag'] | |
headers['Date'] = response.headers['Date'] | |
headers['Last-Modified'] = response.headers['Last-Modified'] | |
body = content | |
return HTTPResponse(body, **headers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment