Commit fca957086eed200c4bdbecbab6bbb4eaaed740c0

Authored by Dmitriy Zaporozhets
2 parents f73d7181 aefe4dc3

Merge pull request #1020 from SaitoWu/feature/https

Feature/https
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
... ...