mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-16 08:06:08 +10:00
Fix git over HTTP
This commit is contained in:
@@ -53,6 +53,10 @@ module Grack
|
||||
end
|
||||
end
|
||||
|
||||
def can?(object, action, subject)
|
||||
abilities.allowed?(object, action, subject)
|
||||
end
|
||||
|
||||
def current_ref
|
||||
if @env["HTTP_CONTENT_ENCODING"] =~ /gzip/
|
||||
input = Zlib::GzipReader.new(@request.body).read
|
||||
@@ -63,5 +67,15 @@ module Grack
|
||||
@request.body.rewind
|
||||
/refs\/heads\/([\w-]+)/.match(input).to_a.first
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def abilities
|
||||
@abilities ||= begin
|
||||
abilities = Six.new
|
||||
abilities << Ability
|
||||
abilities
|
||||
end
|
||||
end
|
||||
end# Auth
|
||||
end# Grack
|
||||
|
||||
Reference in New Issue
Block a user