summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-11-01 11:56:00 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-11-01 11:56:00 +0000
commitf12386aa9acf19877161bfc77e55572f40509cc4 (patch)
treec54e5216f4a7a71fb446e7c3708cb6941a291ce2 /config
parentb64b61bfe72c54fe4a7fdce34b2f1591e3822e5e (diff)
downloadgitlab-ce-f12386aa9acf19877161bfc77e55572f40509cc4.tar.gz
Add latest changes from gitlab-org/security/gitlab@15-5-stable-ee
Diffstat (limited to 'config')
-rw-r--r--config/initializers/uri.rb3
-rw-r--r--config/routes/repository_deprecated.rb8
2 files changed, 9 insertions, 2 deletions
diff --git a/config/initializers/uri.rb b/config/initializers/uri.rb
new file mode 100644
index 00000000000..624f7c4d031
--- /dev/null
+++ b/config/initializers/uri.rb
@@ -0,0 +1,3 @@
+# frozen_string_literal: true
+
+URI.singleton_class.prepend(Gitlab::Patch::Uri::ClassMethods)
diff --git a/config/routes/repository_deprecated.rb b/config/routes/repository_deprecated.rb
index e611b4f665b..32682000941 100644
--- a/config/routes/repository_deprecated.rb
+++ b/config/routes/repository_deprecated.rb
@@ -18,8 +18,12 @@ scope format: false do
constraints: { id: Gitlab::PathRegex.git_reference_regex }
get '/refs/:id/logs_tree/*path',
- to: redirect('%{namespace_id}/%{project_id}/-/refs/%{id}/logs_tree/%{path}'),
- constraints: { id: /.*/, path: /[^\0]*/ }
+ constraints: { id: /.*/, path: /[^\0]*/ },
+ to: redirect { |params, _request|
+ path = params[:path]
+ path.gsub!('@', '-/')
+ Addressable::URI.escape("#{params[:namespace_id]}/#{params[:project_id]}/-/refs/#{params[:id]}/logs_tree/#{path}")
+ }
scope constraints: { id: /[^\0]+/ } do
# Deprecated. Keep for compatibility.