Commit bb63459d537fcd658be0638527e33fc1df56a48f

Authored by Sato Hiroyuki
1 parent 6224ac06

Fix routing errors.

It should fix #2598.
Showing 1 changed file with 3 additions and 3 deletions   Show diff stats
config/routes.rb
@@ -165,7 +165,7 @@ Gitlab::Application.routes.draw do @@ -165,7 +165,7 @@ Gitlab::Application.routes.draw do
165 # 165 #
166 # Project Area 166 # Project Area
167 # 167 #
168 - resources :projects, constraints: { id: /[a-zA-Z.0-9_\-\/]+/ }, except: [:new, :create, :index], path: "/" do 168 + resources :projects, constraints: { id: /(?:[a-zA-Z.0-9_\-]+\/)?[a-zA-Z.0-9_\-]+/ }, except: [:new, :create, :index], path: "/" do
169 member do 169 member do
170 get "wall" 170 get "wall"
171 get "files" 171 get "files"
@@ -174,10 +174,10 @@ Gitlab::Application.routes.draw do @@ -174,10 +174,10 @@ Gitlab::Application.routes.draw do
174 resources :blob, only: [:show], constraints: {id: /.+/} 174 resources :blob, only: [:show], constraints: {id: /.+/}
175 resources :tree, only: [:show, :edit, :update], constraints: {id: /.+/} 175 resources :tree, only: [:show, :edit, :update], constraints: {id: /.+/}
176 resources :commit, only: [:show], constraints: {id: /[[:alnum:]]{6,40}/} 176 resources :commit, only: [:show], constraints: {id: /[[:alnum:]]{6,40}/}
177 - resources :commits, only: [:show], constraints: {id: /.+/} 177 + resources :commits, only: [:show], constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/}
178 resources :compare, only: [:index, :create] 178 resources :compare, only: [:index, :create]
179 resources :blame, only: [:show], constraints: {id: /.+/} 179 resources :blame, only: [:show], constraints: {id: /.+/}
180 - resources :graph, only: [:show], constraints: {id: /.+/} 180 + resources :graph, only: [:show], constraints: {id: /(?:[^.]|\.(?!json$))+/, format: /json/}
181 match "/compare/:from...:to" => "compare#show", as: "compare", 181 match "/compare/:from...:to" => "compare#show", as: "compare",
182 :via => [:get, :post], constraints: {from: /.+/, to: /.+/} 182 :via => [:get, :post], constraints: {from: /.+/, to: /.+/}
183 183