diff options
author | Peter Fern <github@obfusc8.org> | 2013-09-02 20:48:32 +1000 |
---|---|---|
committer | Peter Fern <github@obfusc8.org> | 2013-10-24 16:31:15 +1100 |
commit | 05c988419f438ec72556f3a52227c62943c67845 (patch) | |
tree | 78ac3ba4217a163ce494a8e9dda20edfe0024207 /config | |
parent | 4ab27017e51cd48cf9f733a6dde2056b7da45d52 (diff) | |
download | gitlab-ce-05c988419f438ec72556f3a52227c62943c67845.tar.gz |
Expand refs constraints to include valid characters
Fixes #4831, #4865, #4932
Diffstat (limited to 'config')
-rw-r--r-- | config/routes.rb | 12 |
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 |