summaryrefslogtreecommitdiff
path: root/config/routes
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-03 21:06:23 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-03 21:06:23 +0000
commit4529c19950e412f0461910585414f8633d3b1b18 (patch)
tree00b75c579ef52b41fea09c516cd5286dee5df703 /config/routes
parentab7cf450ba19cf80b9534f25dc707b33845e3014 (diff)
downloadgitlab-ce-4529c19950e412f0461910585414f8633d3b1b18.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'config/routes')
-rw-r--r--config/routes/project.rb30
1 files changed, 15 insertions, 15 deletions
diff --git a/config/routes/project.rb b/config/routes/project.rb
index 848846b5f5b..8a5e20c8eff 100644
--- a/config/routes/project.rb
+++ b/config/routes/project.rb
@@ -58,7 +58,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
get :trace, defaults: { format: 'json' }
get :raw
get :terminal
- get '/terminal.ws/authorize', to: 'jobs#terminal_websocket_authorize', constraints: { format: nil }
+ get '/terminal.ws/authorize', to: 'jobs#terminal_websocket_authorize', format: false
end
resource :artifacts, only: [] do
@@ -228,7 +228,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
get :metrics
get :additional_metrics
get :metrics_dashboard
- get '/terminal.ws/authorize', to: 'environments#terminal_websocket_authorize', constraints: { format: nil }
+ get '/terminal.ws/authorize', to: 'environments#terminal_websocket_authorize', format: false
get '/prometheus/api/v1/*proxy_path', to: 'environments/prometheus_api#proxy', as: :prometheus_api
end
@@ -328,13 +328,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
get :test_reports
get :exposed_artifacts
- scope constraints: { format: nil }, action: :show do
- get :commits, defaults: { tab: 'commits' }
- get :pipelines, defaults: { tab: 'pipelines' }
- get :diffs, defaults: { tab: 'diffs' }
- end
-
- scope constraints: { format: 'json' }, as: :json do
+ scope constraints: ->(req) { req.format == :json }, as: :json do
get :commits
get :pipelines
get :diffs, to: 'merge_requests/diffs#show'
@@ -344,6 +338,12 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
get :cached_widget, to: 'merge_requests/content#cached_widget'
end
+ scope action: :show do
+ get :commits, defaults: { tab: 'commits' }
+ get :pipelines, defaults: { tab: 'pipelines' }
+ get :diffs, defaults: { tab: 'diffs' }
+ end
+
get :diff_for_path, controller: 'merge_requests/diffs'
scope controller: 'merge_requests/conflicts' do
@@ -372,16 +372,16 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
scope path: 'new', as: :new_merge_request do
get '', action: :new
- scope constraints: { format: nil }, action: :new do
- get :diffs, defaults: { tab: 'diffs' }
- get :pipelines, defaults: { tab: 'pipelines' }
- end
-
- scope constraints: { format: 'json' }, as: :json do
+ scope constraints: ->(req) { req.format == :json }, as: :json do
get :diffs
get :pipelines
end
+ scope action: :new do
+ get :diffs, defaults: { tab: 'diffs' }
+ get :pipelines, defaults: { tab: 'pipelines' }
+ end
+
get :diff_for_path
get :branch_from
get :branch_to