Last active
April 4, 2018 10:24
-
-
Save kig-odoo/194c02ea544d5401f81a86aa3f3cc535 to your computer and use it in GitHub Desktop.
This file contains 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
@http.route('/web_editor/get_cross_origin_img', type='http', auth='user') | |
def get_cross_origin_img(self, url): | |
content = requests.get(url, stream=True) | |
# validate here for image size and type from content.headers | |
return request.make_response(content.raw, headers=[('Content-Type', content.headers.get('Content-Type', 'image/png'))]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment