Commit bb63459d537fcd658be0638527e33fc1df56a48f
1 parent
6224ac06
Exists in
master
and in
4 other branches
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 | 165 | # |
| 166 | 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 | 169 | member do |
| 170 | 170 | get "wall" |
| 171 | 171 | get "files" |
| ... | ... | @@ -174,10 +174,10 @@ Gitlab::Application.routes.draw do |
| 174 | 174 | resources :blob, only: [:show], constraints: {id: /.+/} |
| 175 | 175 | resources :tree, only: [:show, :edit, :update], constraints: {id: /.+/} |
| 176 | 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 | 178 | resources :compare, only: [:index, :create] |
| 179 | 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 | 181 | match "/compare/:from...:to" => "compare#show", as: "compare", |
| 182 | 182 | :via => [:get, :post], constraints: {from: /.+/, to: /.+/} |
| 183 | 183 | ... | ... |