Skip to content
Snippets Groups Projects
Commit 893ce9ae authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Fix git over HTTP

parent da854542
No related branches found
No related tags found
No related merge requests found
Loading
@@ -53,6 +53,10 @@ module Grack
Loading
@@ -53,6 +53,10 @@ module Grack
end end
end end
   
def can?(object, action, subject)
abilities.allowed?(object, action, subject)
end
def current_ref def current_ref
if @env["HTTP_CONTENT_ENCODING"] =~ /gzip/ if @env["HTTP_CONTENT_ENCODING"] =~ /gzip/
input = Zlib::GzipReader.new(@request.body).read input = Zlib::GzipReader.new(@request.body).read
Loading
@@ -63,5 +67,15 @@ module Grack
Loading
@@ -63,5 +67,15 @@ module Grack
@request.body.rewind @request.body.rewind
/refs\/heads\/([\w-]+)/.match(input).to_a.first /refs\/heads\/([\w-]+)/.match(input).to_a.first
end end
protected
def abilities
@abilities ||= begin
abilities = Six.new
abilities << Ability
abilities
end
end
end# Auth end# Auth
end# Grack end# Grack
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment