summaryrefslogtreecommitdiff
path: root/lib/gitlab/jira/dvcs.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/jira/dvcs.rb')
-rw-r--r--lib/gitlab/jira/dvcs.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/gitlab/jira/dvcs.rb b/lib/gitlab/jira/dvcs.rb
index ddf2cd76709..41a039674b3 100644
--- a/lib/gitlab/jira/dvcs.rb
+++ b/lib/gitlab/jira/dvcs.rb
@@ -38,7 +38,8 @@ module Gitlab
# @param [String] namespace
def self.restore_full_path(namespace:, project:)
if project.include?(ENCODED_SLASH)
- project.gsub(ENCODED_SLASH, SLASH)
+ # Replace multiple slashes with single ones to make sure the redirect stays on the same host
+ project.gsub(ENCODED_SLASH, SLASH).gsub(%r{\/{2,}}, '/')
else
"#{namespace}/#{project}"
end