diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-22 15:08:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-22 15:08:47 +0300 |
commit | 6046a605fdbb6d180861c978d17fe3516b2e7507 (patch) | |
tree | 42cc483042b341475ba14d8fbfad6432a15327f4 /config/routes | |
parent | 5956978e1d2aa2b5b35c2d79f67f6b9706b8ec4e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'config/routes')
-rw-r--r-- | config/routes/project.rb | 6 | ||||
-rw-r--r-- | config/routes/snippets.rb | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/config/routes/project.rb b/config/routes/project.rb index 78dcc189d5b..d00e0ab1d04 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -313,6 +313,12 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do end end + get '/snippets/:snippet_id/raw/:ref/*path', + to: 'snippets/blobs#raw', + format: false, + as: :snippet_blob_raw, + constraints: { snippet_id: /\d+/ } + draw :issues draw :merge_requests draw :pipelines diff --git a/config/routes/snippets.rb b/config/routes/snippets.rb index ba6da3ac57e..259e88ba7b2 100644 --- a/config/routes/snippets.rb +++ b/config/routes/snippets.rb @@ -17,5 +17,14 @@ resources :snippets, concerns: :awardable do end end +# Use this /-/ scope for all new snippet routes. +scope path: '-' do + get '/snippets/:snippet_id/raw/:ref/*path', + to: 'snippets/blobs#raw', + as: :snippet_raw, + format: false, + constraints: { snippet_id: /\d+/ } +end + get '/s/:username', to: redirect('users/%{username}/snippets'), constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ } |