Permalink
Browse files

Fixing wrong URL unquoting done by tornado. Fixes #103. Released in v…

…ersion 3.2.0
  • Loading branch information...
1 parent f696a81 commit 3b218c14a8277b1115fac1c0dcd3e6a891b34615 @heynemann heynemann committed Jul 18, 2012
Showing with 5 additions and 2 deletions.
  1. +1 −1 thumbor/__init__.py
  2. +3 −0 thumbor/handlers/image.py
  3. +1 −1 thumbor/loaders/http_loader.py
View
@@ -10,4 +10,4 @@
'''This is the main module in thumbor'''
-__version__ = "3.1.1"
+__version__ = "3.2.0"
@@ -8,6 +8,8 @@
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
+from urllib import quote
+
import tornado.web
from thumbor.handlers import ContextHandler
@@ -31,6 +33,7 @@ def get(self, **kw):
if (self.request.query):
self.context.request.image_url += '?%s' % self.request.query
+ self.context.request.image_url = quote(self.context.request.image_url, '/:?%=&')
has_none = not self.context.request.unsafe and not self.context.request.hash
has_both = self.context.request.unsafe and self.context.request.hash
@@ -31,7 +31,7 @@ def validate(context, url):
return False
def return_contents(response, callback):
- if response.error or not response.headers['Content-Type'][:6] == 'image/' or len(response.body) == 0:
+ if response.error or not response.headers['Content-Type'][:5] == 'image' or len(response.body) == 0:
callback(None)
else:
callback(response.body)

0 comments on commit 3b218c1

Please sign in to comment.