Commit fca957086eed200c4bdbecbab6bbb4eaaed740c0
Exists in
master
and in
4 other branches
Merge pull request #1020 from SaitoWu/feature/https
Feature/https
Showing
2 changed files
with
5 additions
and
2 deletions
Show diff stats
config/initializers/grack_auth.rb
| ... | ... | @@ -5,7 +5,10 @@ module Grack |
| 5 | 5 | # Authentication with username and password |
| 6 | 6 | email, password = @auth.credentials |
| 7 | 7 | user = User.find_by_email(email) |
| 8 | - return false unless user.valid_password?(password) | |
| 8 | + return false unless user.try(:valid_password?, password) | |
| 9 | + | |
| 10 | + # Need this patch because the rails mount | |
| 11 | + @env['PATH_INFO'] = @env['REQUEST_PATH'] | |
| 9 | 12 | |
| 10 | 13 | # Find project by PATH_INFO from env |
| 11 | 14 | if m = /^\/([\w-]+).git/.match(@env['PATH_INFO']).to_a | ... | ... |
config/routes.rb
| ... | ... | @@ -18,7 +18,7 @@ Gitlab::Application.routes.draw do |
| 18 | 18 | project_root: GIT_HOST['base_path'], |
| 19 | 19 | upload_pack: GIT_HOST['upload_pack'], |
| 20 | 20 | receive_pack: GIT_HOST['receive_pack'] |
| 21 | - }), at: '/git' | |
| 21 | + }), at: '/:path', constraints: { path: /[\w-]+.git*/ } | |
| 22 | 22 | |
| 23 | 23 | # |
| 24 | 24 | # Help | ... | ... |