From 33ce416436fdc1e6dffcc8d1ee824261861adabf Mon Sep 17 00:00:00 2001 From: ubeddulla khan Date: Sat, 4 Jul 2026 13:42:02 +0530 Subject: [PATCH] anchor host label validators with \Z to reject trailing newline --- botocore/endpoint_provider.py | 2 +- botocore/handlers.py | 2 +- botocore/serialize.py | 2 +- botocore/utils.py | 6 ++++-- tests/unit/test_utils.py | 13 +++++++++++++ 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/botocore/endpoint_provider.py b/botocore/endpoint_provider.py index 69f9a11a08..08d03a18b7 100644 --- a/botocore/endpoint_provider.py +++ b/botocore/endpoint_provider.py @@ -44,7 +44,7 @@ TEMPLATE_STRING_RE = re.compile(r"\{[a-zA-Z#]+\}") GET_ATTR_RE = re.compile(r"(\w*)\[(\d+)\]") VALID_HOST_LABEL_RE = re.compile( - r"^(?!-)[a-zA-Z\d-]{1,63}(?