projects
/
hamn.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d290b84
)
Have redirector generate a robots.txt file if requested
author
Magnus Hagander
<magnus@hagander.net>
Fri, 25 Dec 2020 15:16:11 +0000
(16:16 +0100)
committer
Magnus Hagander
<magnus@hagander.net>
Fri, 25 Dec 2020 16:08:56 +0000
(17:08 +0100)
redirector/redirector.py
patch
|
blob
|
blame
|
history
diff --git
a/redirector/redirector.py
b/redirector/redirector.py
index cb9f141294071d607e74d4d5fc64fbd20574e18a..119f595f5de4f45ed767ed1f0ad9ff11fa4de530 100755
(executable)
--- 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.