From 6c122248f595a338e565bf73b1b6e5a2b761b894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9ry=20Mathieu=20=28Mathius=29?= Date: Thu, 14 Apr 2022 22:42:21 +0200 Subject: [PATCH] Update regex reduce_uri utils Follow this comment : https://github.com/iv-org/invidious/pull/2936#discussion_r850712676 --- src/invidious/helpers/utils.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious/helpers/utils.cr b/src/invidious/helpers/utils.cr index 8180ab6f..9d403ddc 100644 --- a/src/invidious/helpers/utils.cr +++ b/src/invidious/helpers/utils.cr @@ -367,7 +367,7 @@ def fetch_random_instance end def reduce_uri(uri : URI | String, max_length : Int32 = 50, suffix : String = "…") : String - str = uri.to_s.sub(/https?:\/\//, "") + str = uri.to_s.sub(/^https?:\/\//, "") if str.size > max_length str = "#{str[0, max_length]}#{suffix}" end