--
This commit is contained in:
@@ -233,12 +233,13 @@ async def default_response(request: Request, full_path: str) -> Response:
|
|||||||
except PermissionError:
|
except PermissionError:
|
||||||
return error_page(templates, request, 403, "何をしてるんです?脆弱性報告のためならいいのですが、データ盗んで悪用するためなら今すぐにやめてくださいね?", "ディレクトリトラバーサルね、知ってる。公開してないところ覗きたいの?えっt")
|
return error_page(templates, request, 403, "何をしてるんです?脆弱性報告のためならいいのですが、データ盗んで悪用するためなら今すぐにやめてくださいね?", "ディレクトリトラバーサルね、知ってる。公開してないところ覗きたいの?えっt")
|
||||||
|
|
||||||
markdown_mode = False
|
|
||||||
original_path = full_path
|
original_path = full_path
|
||||||
|
markdown_mode = False
|
||||||
|
markdown_ua = ["curl", "claude-user", "chatgpt-user", "google-extended", "perplexity-user"]
|
||||||
|
|
||||||
if "curl" in request.headers.get("user-agent", "").lower():
|
if "text/markdown" in request.headers.get("accept", "").lower():
|
||||||
markdown_mode = True
|
markdown_mode = True
|
||||||
elif "text/markdown" in request.headers.get("accept", "").lower():
|
elif any([ua in request.headers.get("user-agent", "").lower() for ua in markdown_ua]):
|
||||||
markdown_mode = True
|
markdown_mode = True
|
||||||
|
|
||||||
if full_path.endswith(".md"):
|
if full_path.endswith(".md"):
|
||||||
|
|||||||
Reference in New Issue
Block a user