fix: trace was passed in the request method shortened url for trace
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -178,3 +178,9 @@ def match_length(length_1: int | None, length_2: int | None) -> bool:
|
||||
if length_1 is None or length_2 is None:
|
||||
return True
|
||||
return abs(length_1 - length_2) <= ALLOWED_LENGTH_DISTANCE
|
||||
|
||||
def shorten_display_url(url: str, max_length: int = 150, chars_at_end: int = 4, shorten_string: str = "[...]") -> str:
|
||||
if len(url) <= max_length + chars_at_end + len(shorten_string):
|
||||
return url
|
||||
|
||||
return url[:max_length] + shorten_string + url[-chars_at_end:]
|
||||
|
||||
Reference in New Issue
Block a user