From 53c1b923f8a26e537c90495ee4888f1a5a7ddec2 Mon Sep 17 00:00:00 2001 From: Abdullah AlOsaimi Date: Thu, 16 Oct 2025 10:25:46 +0300 Subject: [PATCH] accept single-label hostnames in validate_url Signed-off-by: Abdullah AlOsaimi --- src/vllm_router/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vllm_router/utils.py b/src/vllm_router/utils.py index 17b4464e0..856725e2c 100644 --- a/src/vllm_router/utils.py +++ b/src/vllm_router/utils.py @@ -157,6 +157,7 @@ def validate_url(url: str) -> bool: regex = re.compile( r"^(http|https)://" # Protocol r"(([a-zA-Z0-9_-]+\.)+[a-zA-Z]{2,}|" # Domain name + r"[a-zA-Z0-9_-]+|" # single-label r"localhost|" # Or localhost r"\d{1,3}(\.\d{1,3}){3})" # Or IPv4 address r"(:\d+)?" # Optional port