fix: Update regex to allow xn-- domains

This commit is contained in:
Nathan Woodburn 2025-02-27 13:24:37 +11:00
parent 06749d2c07
commit c4b1be2149
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
2 changed files with 2 additions and 2 deletions
server.py
templates/assets/js

View File

@ -106,7 +106,7 @@ def catch_all(path: str):
#region API routes
@app.route("/api/v1/ssl/<domain>")
def api_ssl(domain: str):
regexmatch = re.match(r"^([a-z0-9]+(-[a-z0-9]+)*\.)*([a-z0-9]+(-[a-z0-9]+)*)$", domain)
regexmatch = re.match(r"^([a-z0-9]+(-[a-z0-9]+)*\.)*([a-z0-9]+([-a-z0-9])*)$", domain)
if not regexmatch:
return api_error("Please provide a valid domain to check")
result = tools.check_ssl(domain)

View File

@ -12,7 +12,7 @@ document.getElementById("domain").addEventListener("keyup", function (event) {
function getSSL() {
// Get the input value
const domain = document.getElementById("domain").value;
const domain = document.getElementById("domain").value.trim().toLowerCase();
// Set the domain parameter
const params = new URLSearchParams();
params.append("domain", domain);