From 508c094f484011517fdc8adaeffe04a5c9d123fb Mon Sep 17 00:00:00 2001 From: echel0n Date: Mon, 30 Jun 2014 01:12:41 -0700 Subject: [PATCH] Fixed robots.txt method. --- sickbeard/webserve.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 997fc859..caa7277c 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -172,6 +172,10 @@ class MainHandler(RequestHandler): path = self.request.uri.replace(sickbeard.WEB_ROOT, '').split('?')[0] method = path.strip('/').split('/')[-1] + + if method == 'robots.txt': + method = 'robots_txt' + if path.startswith('/api') and method != 'builder': apikey = path.strip('/').split('/')[-1] method = path.strip('/').split('/')[0] @@ -225,7 +229,7 @@ class MainHandler(RequestHandler): def robots_txt(self, *args, **kwargs): """ Keep web crawlers out """ self.set_header('Content-Type', 'text/plain') - return 'User-agent: *\nDisallow: /\n' + return "User-agent: *\nDisallow: /" def showPoster(self, show=None, which=None): # Redirect initial poster/banner thumb to default images