diff options
author | Marin Jankovski <maxlazio@gmail.com> | 2019-07-03 11:55:42 +0200 |
---|---|---|
committer | Marin Jankovski <maxlazio@gmail.com> | 2019-07-03 11:55:42 +0200 |
commit | 49d689fb3c7781c861f995aaafef4b224581020b (patch) | |
tree | d13db636b3756f7985431420f0aae6f0b234b14a /config/routes | |
parent | ab0c3e086f5c0fc3eeb1335bbe4c8de02676dc16 (diff) | |
parent | bebbb43f7133cc03c3a9944d2a4b9586a6a0d06f (diff) | |
download | gitlab-ce-49d689fb3c7781c861f995aaafef4b224581020b.tar.gz |
Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq
Diffstat (limited to 'config/routes')
-rw-r--r-- | config/routes/project.rb | 5 | ||||
-rw-r--r-- | config/routes/uploads.rb | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/config/routes/project.rb b/config/routes/project.rb index bcbbd7222e0..0e72e8631cf 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -182,7 +182,10 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do # # Templates # - get '/templates/:template_type/:key' => 'templates#show', as: :template, constraints: { key: %r{[^/]+} } + get '/templates/:template_type/:key' => 'templates#show', + as: :template, + defaults: { format: 'json' }, + constraints: { key: %r{[^/]+}, template_type: %r{issue|merge_request}, format: 'json' } resources :commit, only: [:show], constraints: { id: /\h{7,40}/ } do member do diff --git a/config/routes/uploads.rb b/config/routes/uploads.rb index b594f55f8a0..920f8454ce2 100644 --- a/config/routes/uploads.rb +++ b/config/routes/uploads.rb @@ -7,7 +7,7 @@ scope path: :uploads do # show uploads for models, snippets (notes) available for now get '-/system/:model/:id/:secret/:filename', to: 'uploads#show', - constraints: { model: /personal_snippet/, id: /\d+/, filename: %r{[^/]+} } + constraints: { model: /personal_snippet|user/, id: /\d+/, filename: %r{[^/]+} } # show temporary uploads get '-/system/temp/:secret/:filename', @@ -28,7 +28,7 @@ scope path: :uploads do # create uploads for models, snippets (notes) available for now post ':model', to: 'uploads#create', - constraints: { model: /personal_snippet/, id: /\d+/ }, + constraints: { model: /personal_snippet|user/, id: /\d+/ }, as: 'upload' end |