mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
De-stale c.site for stylesheet requests.
Since we're using nginx in front of subreddit stylesheets to protect ourselves from ponies, we need to make sure we don't give a stale copy of the CSS when requested with the new query param thereby poisoning nginx's cache.
This commit is contained in:
@@ -358,6 +358,10 @@ class FrontController(RedditController):
|
||||
return res
|
||||
|
||||
def GET_stylesheet(self):
|
||||
# de-stale the subreddit object so we don't poison nginx's cache
|
||||
if not isinstance(c.site, FakeSubreddit):
|
||||
c.site = Subreddit._byID(c.site._id, data=True, stale=False)
|
||||
|
||||
if hasattr(c.site,'stylesheet_contents') and not g.css_killswitch:
|
||||
c.allow_loggedin_cache = True
|
||||
self.check_modified(c.site,'stylesheet_contents',
|
||||
|
||||
Reference in New Issue
Block a user