Skip to content

Commit fa2c5fd

Browse files
authored
change the order, strip, then truncate (#2663)
1 parent 63a83c6 commit fa2c5fd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

auth-api/src/auth_api/services/api_gateway.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,4 +265,5 @@ def _get_api_consumer_endpoint(cls, env):
265265
def _make_string_compatible(cls, target: str) -> str:
266266
"""Make string compatible for API gateway."""
267267
# Length 255 max - alphanumeric, space, and the following: . _ -
268-
return re.sub(r'[^a-zA-Z0-9_\- .]', '', target[:255])
268+
target = re.sub(r'[^a-zA-Z0-9_\- .]', '', target)
269+
return target[:255]

0 commit comments

Comments
 (0)