This commit is contained in:
2026-01-22 00:36:48 +01:00
parent cb476c0a1a
commit f297a8d740
6 changed files with 86 additions and 160 deletions

View File

@@ -15,10 +15,9 @@ from urllib.parse import parse_qs, urlparse
import argon2
from .cleanup import ExpiredRecordsCleanupThread, RateLimitCleanupThread
from .dns import detect_ip_type
from .logging import clear_txn_id, set_txn_id
from .models import DoesNotExist, get_hostname_for_user, get_user
from .validation import encode_hostname, ValidationError
from .dns import detect_ip_type, encode_dnsname, EncodingError
def extract_param(params, aliases):
@@ -227,8 +226,8 @@ class DDNSRequestHandler(BaseHTTPRequestHandler):
# Validate and encode hostname
try:
hostname_param = encode_hostname(hostname_param)
except ValidationError:
hostname_param = encode_dnsname(hostname_param)
except EncodingError:
logging.warning(
f"Invalid hostname: client={client_ip}, "
f"hostname={hostname_param}")