mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
Update regex reduce_uri utils
Follow this comment : https://github.com/iv-org/invidious/pull/2936#discussion_r850712676
This commit is contained in:
parent
68ac18dc98
commit
6c122248f5
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue