From 5705be4b63afe2f39675a0adc8f44e1f1a44a05c Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Tue, 17 Sep 2013 11:58:54 -0700 Subject: [PATCH] /stylesheet.css: Don't attempt to redirect to `None`. Caused when a subreddit has a static stylesheet, but not a secure static stylesheet and /r/whatever/stylesheet.css is accessed over HTTPS. --- r2/r2/controllers/front.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/r2/r2/controllers/front.py b/r2/r2/controllers/front.py index a86ef5118..6a9849160 100755 --- a/r2/r2/controllers/front.py +++ b/r2/r2/controllers/front.py @@ -407,7 +407,11 @@ class FrontController(RedditController, OAuth2ResourceController): if c.site.stylesheet_is_static: # TODO: X-Private-Subreddit? - redirect_to(Reddit.get_subreddit_stylesheet_url()) + url = Reddit.get_subreddit_stylesheet_url() + if url: + redirect_to(url) + else: + self.abort404() else: if not c.secure: stylesheet_contents = c.site.stylesheet_contents