From 985921a56d60d97c4a1dc1ded074482ece400158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20=C5=9Awi=C4=85tkowski?= Date: Fri, 18 Oct 2013 12:22:37 +0200 Subject: [PATCH] fix error with @-sign in branch names --- config/routes.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 6d7358608ea..c13e476b3ee 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,8 @@ require 'sidekiq/web' require 'api/api' +ROUTES_BRANCH_NAME_REGEXP = /[a-zA-Z.\/0-9_\-#%+@]+/ + Gitlab::Application.routes.draw do # # Search @@ -222,14 +224,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: ROUTES_BRANCH_NAME_REGEXP } do collection do get :recent 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: ROUTES_BRANCH_NAME_REGEXP } + resources :protected_branches, only: [:index, :create, :destroy], constraints: { id: ROUTES_BRANCH_NAME_REGEXP } resources :refs, only: [] do collection do @@ -238,11 +240,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: ROUTES_BRANCH_NAME_REGEXP } get "logs_tree/:path" => "refs#logs_tree", as: :logs_file, constraints: { - id: /[a-zA-Z.0-9\/_\-#%+]+/, + id: ROUTES_BRANCH_NAME_REGEXP, path: /.*/ } end @@ -284,7 +286,7 @@ Gitlab::Application.routes.draw do end end - resources :team_members, except: [:index, :edit], constraints: { id: /[a-zA-Z.\/0-9_\-#%+]+/ } do + resources :team_members, except: [:index, :edit], constraints: { id: ROUTES_BRANCH_NAME_REGEXP } do collection do # Used for import team -- GitLab