too much code will kill you. Start simple, and go from there onwards. def test(): url = 'http://creativity103.com/collections/Landscape/golf_course.jpg' r = requests.get(url) if r.status_code == 200: newheaders = r.headers meaningful = ['Content-Length', 'Content-Type', 'Date', 'Expires', 'Last-Modified'] for k in meaningful: if k in newheaders: response.headers[k] = newheaders[k] return r.content raise HTTP(404)
On Tuesday, September 9, 2014 11:48:58 PM UTC+2, Manuele wrote: > > Il 09/09/14 22:22, Niphlod ha scritto: > > nope. base64 is just a way to turn binary into text, and you want to > > stream a binary, not the text that represents it in base64. > I prepared a little example based on my solution. It's a as simple as I > can image proxy composed by a module[1] and a controller[2]. > Visiting the url: > http://localhost:8000/test_imgproxy/proxy/index/golf_course.jpg you will > not see the desidered image[3]. > > Can you tell me what's wrong in my approach? > > Thanks a lot > > Manuele > > [1] http://paste.debian.net/120108/ > [2] http://paste.debian.net/120109/ > [3] http://creativity103.com/collections/Landscape/golf_course.jpg > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.