Skip to content

Commit

Permalink
fix to serve the correct content type for the json and jsonp responses
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiomcosta committed Jul 21, 2011
1 parent 9c7ebd9 commit d65ae6e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions thumbor/handlers/__init__.py
Expand Up @@ -4,7 +4,7 @@
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki

# Licensed under the MIT license:
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com

Expand Down Expand Up @@ -139,7 +139,11 @@ def callback(buffer):

Transformer(context).transform()

content_type = "application/json" if meta else CONTENT_TYPE[context['extension']]
if meta:
content_type = 'text/javascript' if options.META_CALLBACK_NAME else 'application/json'
else:
content_type = CONTENT_TYPE[context['extension']]

self.set_header('Content-Type', content_type)

results = context['engine'].read(context['extension'])
Expand Down

0 comments on commit d65ae6e

Please sign in to comment.