mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-25 06:48:01 -05:00
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:
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user