feat: Update isCurl to isCLI to allow more CLI agents

This commit is contained in:
2025-10-30 17:07:20 +11:00
parent 19c51c3665
commit 844f1b52e2
3 changed files with 17 additions and 11 deletions

View File

@@ -3,7 +3,7 @@ from flask import Blueprint, render_template, request, jsonify
import markdown
from bs4 import BeautifulSoup
import re
from tools import isCurl, getClientIP, getHandshakeScript
from tools import isCLI, getClientIP, getHandshakeScript
blog_bp = Blueprint('blog', __name__)
@@ -110,7 +110,7 @@ def render_home(handshake_scripts: str | None = None):
@blog_bp.route("/")
def index():
if not isCurl(request):
if not isCLI(request):
return render_home(handshake_scripts=getHandshakeScript(request.host))
# Get a list of pages
@@ -131,7 +131,7 @@ def index():
@blog_bp.route("/<path:path>")
def path(path):
if not isCurl(request):
if not isCLI(request):
return render_page(path, handshake_scripts=getHandshakeScript(request.host))
# Convert md to html