Skip to content

Instantly share code, notes, and snippets.

View kig-odoo's full-sized avatar
😇
Proud Father of Theme Prime

Kishan Gajjar kig-odoo

😇
Proud Father of Theme Prime
View GitHub Profile
# initialization file (not found)
@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'))])