mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 08:17:58 -05:00
fix content type
This commit is contained in:
@@ -300,6 +300,10 @@ class ExtensionMiddleware(object):
|
||||
#strip off the extension
|
||||
environ['PATH_INFO'] = path[:-(len(ext) + 1)]
|
||||
break
|
||||
else:
|
||||
environ['render_style'] = 'html'
|
||||
environ['content_type'] = 'text/html; charset=UTF-8'
|
||||
|
||||
return self.app(environ, start_response)
|
||||
|
||||
class RewriteMiddleware(object):
|
||||
|
||||
@@ -247,10 +247,10 @@ def set_subreddit():
|
||||
|
||||
def set_content_type():
|
||||
e = request.environ
|
||||
if e.has_key('extension'):
|
||||
c.render_style = e['render_style']
|
||||
c.response_content_type = e['content_type']
|
||||
c.render_style = e['render_style']
|
||||
c.response_content_type = e['content_type']
|
||||
|
||||
if e.has_key('extension'):
|
||||
ext = e['extension']
|
||||
if ext == 'api' or ext.startswith('json'):
|
||||
c.response_access_control = 'allow <*>'
|
||||
|
||||
Reference in New Issue
Block a user