summaryrefslogtreecommitdiff
path: root/lib/gitlab/routing.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/routing.rb')
-rw-r--r--lib/gitlab/routing.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/routing.rb b/lib/gitlab/routing.rb
index 910533076b0..2c994536060 100644
--- a/lib/gitlab/routing.rb
+++ b/lib/gitlab/routing.rb
@@ -46,10 +46,10 @@ module Gitlab
# Only replace the last occurence of `path`.
#
# `request.fullpath` includes the querystring
- path = request.path.sub(%r{/#{path}/*(?!.*#{path})}, "/-/#{path}/")
- path << "?#{request.query_string}" if request.query_string.present?
+ new_path = request.path.sub(%r{/#{path}(/*)(?!.*#{path})}, "/-/#{path}\\1")
+ new_path << "?#{request.query_string}" if request.query_string.present?
- path
+ new_path
end
paths.each do |path|