From ce37bed7c60d70ea3366f6887df9435fc6753e47 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Fri, 21 Jun 2024 14:54:19 +0200 Subject: [PATCH] WebHost: fix accidental robots.txt capture (#3502) --- WebHostLib/robots.py | 3 ++- WebHostLib/static/{robots.txt => robots_file.txt} | 0 2 files changed, 2 insertions(+), 1 deletion(-) rename WebHostLib/static/{robots.txt => robots_file.txt} (100%) diff --git a/WebHostLib/robots.py b/WebHostLib/robots.py index 410a92c8..93c735c7 100644 --- a/WebHostLib/robots.py +++ b/WebHostLib/robots.py @@ -8,7 +8,8 @@ from . import cache def robots(): # If this host is not official, do not allow search engine crawling if not app.config["ASSET_RIGHTS"]: - return app.send_static_file('robots.txt') + # filename changed in case the path is intercepted and served by an outside service + return app.send_static_file('robots_file.txt') # Send 404 if the host has affirmed this to be the official WebHost abort(404) diff --git a/WebHostLib/static/robots.txt b/WebHostLib/static/robots_file.txt similarity index 100% rename from WebHostLib/static/robots.txt rename to WebHostLib/static/robots_file.txt