From db92483e6bae993f09357c546916b5a1e798d8dc Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Thu, 11 Apr 2024 18:28:00 +0100 Subject: [PATCH] Limit server names to within 255 characters (#229) --- jhub_apps/hub_client/hub_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jhub_apps/hub_client/hub_client.py b/jhub_apps/hub_client/hub_client.py index 1c3d5eac..ef109996 100644 --- a/jhub_apps/hub_client/hub_client.py +++ b/jhub_apps/hub_client/hub_client.py @@ -61,7 +61,8 @@ def normalize_server_name(self, servername): text = re.sub(r"[^a-z0-9\s-]", "", text) # Replace spaces with hyphens text = text.replace(" ", "-") - return text + # Max limit for servername is 255 chars + return text[:240] def start_server(self, username, servername): if not servername: