diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-25 15:07:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-25 15:07:45 +0300 |
commit | 7b1fa4c1a1b784c2f78405dca82e56a009f1e773 (patch) | |
tree | d56557b05ce90b8e4e20f514c835579a3c1e9d85 /lib/gitlab/utils.rb | |
parent | 06b4bed158fc0772cf4363e65baef9ca9357c07b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/utils.rb')
-rw-r--r-- | lib/gitlab/utils.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/utils.rb b/lib/gitlab/utils.rb index d3055569ece..65572c237ec 100644 --- a/lib/gitlab/utils.rb +++ b/lib/gitlab/utils.rb @@ -82,7 +82,11 @@ module Gitlab # Append path to host, making sure there's one single / in between def append_path(host, path) - "#{host.to_s.sub(%r{\/+$}, '')}/#{path.to_s.sub(%r{^\/+}, '')}" + "#{host.to_s.sub(%r{\/+$}, '')}/#{remove_leading_slashes(path)}" + end + + def remove_leading_slashes(str) + str.to_s.sub(%r{^/+}, '') end # A slugified version of the string, suitable for inclusion in URLs and |