Add a custom header to private subreddit CSS.

We'll use this header to disable infrastructure-level
caching to protect subreddit privacy.
This commit is contained in:
Neil Williams
2012-03-09 18:17:19 -08:00
parent 603e14abeb
commit cfd93ee618

View File

@@ -366,6 +366,8 @@ class FrontController(RedditController):
must_revalidate=False)
c.response_content_type = 'text/css'
c.response.content = c.site.stylesheet_contents
if c.site.type == 'private':
c.response.headers['X-Private-Subreddit'] = 'private'
return c.response
else:
return self.abort404()