git 权限问题

dev_cs
jingquan huang 5 years ago
parent 6127cc2ca9
commit 43718728f6

@ -19,6 +19,10 @@ class GitsController < ApplicationController
result = false
if request.env["HTTP_AUTHORIZATION"] && request.env["HTTP_AUTHORIZATION"].split(" ").length == 2
username_password = Base64.decode64(request.env["HTTP_AUTHORIZATION"].split(" ")[1])
if username_password.split(":")[0].nil? || username_password.split(":")[1].nil?
result = false
else
input_username = username_password.split(":")[0].strip()
input_password = username_password.split(":")[1].strip()
uid_logger("git start auth: input_username is #{input_username}")
@ -60,6 +64,7 @@ class GitsController < ApplicationController
end
end
end
end
authenticate_or_request_with_http_basic do |username, password|
result

Loading…
Cancel
Save