diff options
Diffstat (limited to 'config/routes.rb')
-rw-r--r-- | config/routes.rb | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/config/routes.rb b/config/routes.rb index f0a7cf1e8a6..498716b12e0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -69,7 +69,19 @@ Gitlab::Application.routes.draw do end end + # + # Uploads + # + scope path: :uploads do + # Note attachments and User/Group/Project avatars + get ":model/:mounted_as/:id/:filename", to: "uploads#show", + constraints: { model: /note|user|group|project/, mounted_as: /avatar|attachment/, filename: /.+/ } + + # Project markdown uploads + get ":id/:secret/:filename", to: "projects/uploads#show", + constraints: { id: /[a-zA-Z.0-9_\-]+\/[a-zA-Z.0-9_\-]+/, filename: /.+/ } + end # # Explore area @@ -91,11 +103,6 @@ Gitlab::Application.routes.draw do get 'public/projects' => 'explore/projects#index' # - # Attachments serving - # - get 'files/:type/:id/:filename' => 'files#download', constraints: { id: /\d+/, type: /[a-z]+/, filename: /.+/ } - - # # Admin Area # namespace :admin do |