Handle permission errors for static files (Fix for #2358)

Version bump
This commit is contained in:
Ozzie Isaacs
2022-04-03 20:26:43 +02:00
parent fee76741a0
commit 8adae6ed0c
6 changed files with 33 additions and 18 deletions
+5 -1
View File
@@ -1368,7 +1368,11 @@ def get_cover(book_id):
@web.route("/robots.txt")
def get_robots():
return send_from_directory(constants.STATIC_DIR, "robots.txt")
try:
return send_from_directory(constants.STATIC_DIR, "robots.txt")
except PermissionError:
log.error("No permission to access robots.txt file.")
abort(403)
@web.route("/show/<int:book_id>/<book_format>", defaults={'anyname': 'None'})