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
path: root/config
diff options
context:
space:
mode:
authorPeter Fern <github@obfusc8.org>2013-09-02 14:48:32 +0400
committerPeter Fern <github@obfusc8.org>2013-10-24 09:31:15 +0400
commit05c988419f438ec72556f3a52227c62943c67845 (patch)
tree78ac3ba4217a163ce494a8e9dda20edfe0024207 /config
parent4ab27017e51cd48cf9f733a6dde2056b7da45d52 (diff)
Expand refs constraints to include valid characters
Fixes #4831, #4865, #4932
Diffstat (limited to 'config')
-rw-r--r--config/routes.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 6d7358608ea..78f75d11835 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -222,14 +222,14 @@ Gitlab::Application.routes.draw do
end
end
- resources :branches, only: [:index, :new, :create, :destroy], constraints: { id: /[a-zA-Z.\/0-9_\-#%+]+/ } do
+ resources :branches, only: [:index, :new, :create, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex } do
collection do
- get :recent
+ get :recent, constraints: { id: Gitlab::Regex.git_reference_regex }
end
end
- resources :tags, only: [:index, :new, :create, :destroy], constraints: { id: /[a-zA-Z.\/0-9_\-#%+]+/ }
- resources :protected_branches, only: [:index, :create, :destroy], constraints: { id: /[a-zA-Z.\/0-9_\-#%+]+/ }
+ resources :tags, only: [:index, :new, :create, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex }
+ resources :protected_branches, only: [:index, :create, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex }
resources :refs, only: [] do
collection do
@@ -238,11 +238,11 @@ Gitlab::Application.routes.draw do
member do
# tree viewer logs
- get "logs_tree", constraints: { id: /[a-zA-Z.\/0-9_\-#%+]+/ }
+ get "logs_tree", constraints: { id: Gitlab::Regex.git_reference_regex }
get "logs_tree/:path" => "refs#logs_tree",
as: :logs_file,
constraints: {
- id: /[a-zA-Z.0-9\/_\-#%+]+/,
+ id: Gitlab::Regex.git_reference_regex,
path: /.*/
}
end