This commit is contained in:
2026-04-18 20:13:48 +09:00
parent 416b16191a
commit a7cc45a030
+4 -1
View File
@@ -137,10 +137,13 @@ async def default_response(request: Request, full_path: str) -> Response:
return error_page(templates, request, 403, "何をしてるんです?脆弱性報告のためならいいのですが、データ盗んで悪用するためなら今すぐにやめてくださいね?", "ディレクトリトラバーサルね、知ってる。公開してないところ覗きたいの?えっt") return error_page(templates, request, 403, "何をしてるんです?脆弱性報告のためならいいのですが、データ盗んで悪用するためなら今すぐにやめてくださいね?", "ディレクトリトラバーサルね、知ってる。公開してないところ覗きたいの?えっt")
markdown_mode = False markdown_mode = False
original_path = full_path
if "curl" in request.headers.get("user-agent", "").lower(): if "curl" in request.headers.get("user-agent", "").lower():
markdown_mode = True markdown_mode = True
elif "text/markdown" in request.headers.get("accept", "").lower():
markdown_mode = True
original_path = full_path
if full_path.endswith(".md"): if full_path.endswith(".md"):
markdown_mode = True markdown_mode = True
full_path = full_path[:-3] + ".html" full_path = full_path[:-3] + ".html"