diff options
author | Sean McGivern <sean@gitlab.com> | 2016-10-07 16:49:48 +0100 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2016-10-11 13:31:12 +0100 |
commit | 1022456bb15d18b05c14fe344950fb75c7c69f48 (patch) | |
tree | aace3fadc569905719232d73811739961450c22e /config | |
parent | 8581df3bfb9e847d07a585a22cfa21658ae40ea2 (diff) | |
download | gitlab-ce-1022456bb15d18b05c14fe344950fb75c7c69f48.tar.gz |
Allow browsing branches that end with '.atom'
We need to do two things to support this:
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!
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 |