Merge pull request #1297 from SaitoWu/issues/1269
fix git push body bigger than 112k problem
This commit is contained in:
commit
6e520d9cae
|
@ -42,13 +42,13 @@ module Grack
|
||||||
|
|
||||||
def current_ref
|
def current_ref
|
||||||
if @env["HTTP_CONTENT_ENCODING"] =~ /gzip/
|
if @env["HTTP_CONTENT_ENCODING"] =~ /gzip/
|
||||||
input = Zlib::GzipReader.new(@request.body).string
|
input = Zlib::GzipReader.new(@request.body).read
|
||||||
else
|
else
|
||||||
input = @request.body.string
|
input = @request.body.read
|
||||||
end
|
end
|
||||||
|
# Need to reset seek point
|
||||||
oldrev, newrev, ref = input.split(' ')
|
@request.body.rewind
|
||||||
/refs\/heads\/([\w-]+)/.match(ref).to_a.last
|
/refs\/heads\/([\w-]+)/.match(input).to_a.first
|
||||||
end
|
end
|
||||||
end# Auth
|
end# Auth
|
||||||
end# Grack
|
end# Grack
|
||||||
|
|
Loading…
Reference in a new issue