diff --git a/r2/r2/config/routing.py b/r2/r2/config/routing.py index ff8bd11a2..f77fb9f34 100644 --- a/r2/r2/config/routing.py +++ b/r2/r2/config/routing.py @@ -51,6 +51,7 @@ def make_map(global_conf={}, app_conf={}): mc('/about/message/:where', controller='message', action='listing') mc('/about/log', controller='front', action='moderationlog') + mc('/about', controller='front', action='about') mc('/about/:location', controller='front', action='editreddit', location = 'about') diff --git a/r2/r2/controllers/front.py b/r2/r2/controllers/front.py index 6f4b9e6d9..abf9e2271 100644 --- a/r2/r2/controllers/front.py +++ b/r2/r2/controllers/front.py @@ -571,8 +571,8 @@ class FrontController(RedditController): pane = FlairPane(num, after, reverse, name, user) elif c.user_is_sponsor and location == 'ads': pane = RedditAds() - elif (not location or location == "about") and is_api(): - return Reddit(content = Wrapped(c.site)).render() + elif (location == "about") and is_api(): + return self.redirect(add_sr('about.json'), code=301) else: return self.abort404() @@ -606,6 +606,13 @@ class FrontController(RedditController): return self._edit_normal_reddit(location, num, after, reverse, count, created, name, user) + def GET_about(self): + """Return information about the subreddit. + + Data includes the subscriber count, description, and header image.""" + if not is_api() or isinstance(c.site, FakeSubreddit): + return self.abort404() + return Reddit(content = Wrapped(c.site)).render() def GET_awards(self): """The awards page."""