diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/routes/group.rb | 2 | ||||
-rw-r--r-- | config/routes/project.rb | 2 | ||||
-rw-r--r-- | config/routes/uploads.rb | 6 |
3 files changed, 6 insertions, 4 deletions
diff --git a/config/routes/group.rb b/config/routes/group.rb index 30671d4e0a1..24957d5ecef 100644 --- a/config/routes/group.rb +++ b/config/routes/group.rb @@ -68,7 +68,7 @@ constraints(::Constraints::GroupUrlConstrainer.new) do resources :uploads, only: [:create] do collection do - get ":secret/:filename", action: :show, as: :show, constraints: { filename: %r{[^/]+} } + get ":secret/:filename", action: :show, as: :show, constraints: { filename: %r{[^/]+} }, format: false, defaults: { format: nil } post :authorize end end diff --git a/config/routes/project.rb b/config/routes/project.rb index b420f07c7a1..3bc38ef3349 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -452,7 +452,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do resources :uploads, only: [:create] do collection do - get ":secret/:filename", action: :show, as: :show, constraints: { filename: %r{[^/]+} } + get ":secret/:filename", action: :show, as: :show, constraints: { filename: %r{[^/]+} }, format: false, defaults: { format: nil } post :authorize end end diff --git a/config/routes/uploads.rb b/config/routes/uploads.rb index 096ef146e07..fb8af76397c 100644 --- a/config/routes/uploads.rb +++ b/config/routes/uploads.rb @@ -21,9 +21,11 @@ scope path: :uploads do as: 'appearance_upload' # Project markdown uploads + # DEPRECATED: Remove this in GitLab 13.0 because this is redundant to show_namespace_project_uploads + # https://gitlab.com/gitlab-org/gitlab/issues/196396 get ":namespace_id/:project_id/:secret/:filename", - to: "projects/uploads#show", - constraints: { namespace_id: /[a-zA-Z.0-9_\-]+/, project_id: /[a-zA-Z.0-9_\-]+/, filename: %r{[^/]+} } + to: redirect("%{namespace_id}/%{project_id}/uploads/%{secret}/%{filename}"), + constraints: { namespace_id: /[a-zA-Z.0-9_\-]+/, project_id: /[a-zA-Z.0-9_\-]+/, filename: %r{[^/]+} }, format: false, defaults: { format: nil } # create uploads for models, snippets (notes) available for now post ':model', |