ErrorController: Send status code even when not rendering.

Previously, if the current extension were not in allowed_render_styles,
the error's HTTP status code would be swallowed and turned into a 200.
This meant that 404ing stylesheets were actually sending back the text
"404" as an "OK" stylesheet.
This commit is contained in:
Neil Williams
2012-09-22 23:01:48 -07:00
parent 5c2679fbf6
commit bfd2372e63

View File

@@ -165,6 +165,7 @@ class ErrorController(RedditController):
if c.render_style not in self.allowed_render_styles:
if code not in (204, 304):
c.response.content = str(code)
c.response.status_code = code
return c.response
elif c.render_style == "api":
data = request.environ.get('extra_error_data', {'error': code})