diff options
author | Robert Speicher <robert@gitlab.com> | 2016-10-11 14:04:31 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-10-11 14:04:31 +0000 |
commit | 5c6cbfa6cbc6cb82ba20e615c27f98649265b4ce (patch) | |
tree | e8e91e7201426324eb0e0e55dbee5099ca59e801 /config | |
parent | e28623cc6e54fdcce8b4b8432c767c085a2b7bc0 (diff) | |
parent | 1022456bb15d18b05c14fe344950fb75c7c69f48 (diff) | |
download | gitlab-ce-5c6cbfa6cbc6cb82ba20e615c27f98649265b4ce.tar.gz |
Merge branch 'atom-routes' into 'master'
Allow browsing branches that end with '.atom'
## What does this MR do?
1. Simplify the regex capture in the routing for the CommitsController
to not exclude the '.atom' suffix. That's a perfectly valid git
branch name, so we shouldn't blow up if we get it.
2. Because Rails now can't automatically detect the request format, add
some code to do so in `ExtractPath` when there is no path. This means
that, given branches 'foo' and 'foo.atom', the Atom feed for the
former is unroutable. To fix this: don't do that! Give the branches
different names!
## Why was this MR needed?
Creating a branch or tag name ending in '.atom' would cause some 500s on that repo.
## What are the relevant issue numbers?
Closes #21955. Related to !5994.
See merge request !6750
Diffstat (limited to 'config')
-rw-r--r-- | config/routes/project.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/config/routes/project.rb b/config/routes/project.rb index e8807ef06a7..4c1da5c4df5 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -159,7 +159,7 @@ resources :namespaces, path: '/', constraints: { id: /[a-zA-Z.0-9_\-]+/ }, only: get( '/commits/*id', to: 'commits#show', - constraints: { id: /(?:[^.]|\.(?!atom$))+/, format: /atom/ }, + constraints: { id: /.+/, format: false }, as: :commits ) end |