Cleanup
This commit is contained in:
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user