Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-25 15:07:45 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-25 15:07:45 +0300
commit7b1fa4c1a1b784c2f78405dca82e56a009f1e773 (patch)
treed56557b05ce90b8e4e20f514c835579a3c1e9d85 /lib/gitlab/utils.rb
parent06b4bed158fc0772cf4363e65baef9ca9357c07b (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/utils.rb')
-rw-r--r--lib/gitlab/utils.rb6
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