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:
authorwinniehell <git@winniehell.de>2016-07-31 23:52:44 +0300
committerwinniehell <git@winniehell.de>2016-08-02 04:32:28 +0300
commite1832914df2eccea1730586b26e759b562e8b7c1 (patch)
tree12832bec15c046c9bd6593c5c1202e9b63bfd6a4 /config
parent010477edc034330dfe4bce7b4dfac252e1fb0a25 (diff)
Allow branch names ending with .json for graph and network page (!5579)
Diffstat (limited to 'config')
-rw-r--r--config/routes.rb18
1 files changed, 11 insertions, 7 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 371eb4bee7f..2f5f32d9e30 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -626,13 +626,17 @@ Rails.application.routes.draw do
get '/compare/:from...:to', to: 'compare#show', as: 'compare', constraints: { from: /.+/, to: /.+/ }
- resources :network, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ }
-
- resources :graphs, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ } do
- member do
- get :commits
- get :ci
- get :languages
+ # Don't use format parameter as file extension (old 3.0.x behavior)
+ # See http://guides.rubyonrails.org/routing.html#route-globbing-and-wildcard-segments
+ scope format: false do
+ resources :network, only: [:show], constraints: { id: Gitlab::Regex.git_reference_regex }
+
+ resources :graphs, only: [:show], constraints: { id: Gitlab::Regex.git_reference_regex } do
+ member do
+ get :commits
+ get :ci
+ get :languages
+ end
end
end