From 4f9fe484c102e1b8f10d69bd20a98ffb20222d6f Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Fri, 25 Dec 2020 16:16:11 +0100 Subject: [PATCH] Have redirector generate a robots.txt file if requested --- redirector/redirector.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/redirector/redirector.py b/redirector/redirector.py index cb9f141..119f595 100755 --- a/redirector/redirector.py +++ b/redirector/redirector.py @@ -33,6 +33,12 @@ def iddecode(idstr): def application(environ, start_response): + # Generate our own little robots.txt + if environ['REQUEST_URI'].startswith('/robots.txt'): + start_response('200 OK', [ + ('Content-type', 'text/plain'), + ]) + return [b"User-Agent: *\nDisallow: /\n"] try: # If we have a querystring, get rid of it. This can (presumably) # happen with some click-tracking systems. -- 2.39.5