From 4868801ada692354447ffedc19bdc068ff5116de Mon Sep 17 00:00:00 2001 From: Florence Yeun Date: Fri, 24 Jul 2015 10:16:02 -0700 Subject: [PATCH] robots.txt: Disallow /quarantine Restrict crawlers from the quarantined content gate via robots.txt. Also add robots=noindex,nofollow meta tag to /quarantine page. --- r2/r2/controllers/post.py | 5 +++-- r2/r2/templates/robots.txt | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/r2/r2/controllers/post.py b/r2/r2/controllers/post.py index b574e5df3..e77e0dc08 100644 --- a/r2/r2/controllers/post.py +++ b/r2/r2/controllers/post.py @@ -89,10 +89,11 @@ class PostController(ApiController): ) def GET_quarantine(self, dest): sr = UrlParser(dest).get_subreddit() - return BoringPage(_("opt in to potentially offensive content?"), + return BoringPage( + _("opt in to potentially offensive content?"), content=Quarantine(sr.name), show_sidebar=False, - ).render() + robots='noindex,nofollow').render() @validate(VModhash(fatal=False), over18 = nop('over18'), diff --git a/r2/r2/templates/robots.txt b/r2/r2/templates/robots.txt index 31b1af210..172902ca1 100644 --- a/r2/r2/templates/robots.txt +++ b/r2/r2/templates/robots.txt @@ -54,5 +54,6 @@ Disallow: /reddits/search Disallow: /search Disallow: /r/*/search Disallow: /over18 +Disallow: /quarantine Allow: /