Commit bd50a9f466b3df15917b32142bfc325114ef811a
1 parent
d005242d
Exists in
master
and in
4 other branches
grack: allow repositories to have dots in name, e.g. serverconfigs-example.com.git
Showing
2 changed files
with
3 additions
and
3 deletions
Show diff stats
config/routes.rb
| ... | ... | @@ -18,7 +18,7 @@ Gitlab::Application.routes.draw do |
| 18 | 18 | project_root: Gitlab.config.git_base_path, |
| 19 | 19 | upload_pack: Gitlab.config.git_upload_pack, |
| 20 | 20 | receive_pack: Gitlab.config.git_receive_pack |
| 21 | - }), at: '/:path', constraints: { path: /[\w-]+\.git/ } | |
| 21 | + }), at: '/:path', constraints: { path: /[\w\.-]+\.git/ } | |
| 22 | 22 | |
| 23 | 23 | # |
| 24 | 24 | # Help | ... | ... |
lib/gitlab/backend/grack_auth.rb
| ... | ... | @@ -18,7 +18,7 @@ module Grack |
| 18 | 18 | @env['SCRIPT_NAME'] = "" |
| 19 | 19 | |
| 20 | 20 | # Find project by PATH_INFO from env |
| 21 | - if m = /^\/([\w-]+).git/.match(@request.path_info).to_a | |
| 21 | + if m = /^\/([\w\.-]+)\.git/.match(@request.path_info).to_a | |
| 22 | 22 | self.project = Project.find_by_path(m.last) |
| 23 | 23 | return false unless project |
| 24 | 24 | end |
| ... | ... | @@ -65,7 +65,7 @@ module Grack |
| 65 | 65 | end |
| 66 | 66 | # Need to reset seek point |
| 67 | 67 | @request.body.rewind |
| 68 | - /refs\/heads\/([\w-]+)/.match(input).to_a.first | |
| 68 | + /refs\/heads\/([\w\.-]+)/.match(input).to_a.first | |
| 69 | 69 | end |
| 70 | 70 | |
| 71 | 71 | protected | ... | ... |