From 74d65bb8238923d04dde6eefc657a40995c8e4ff Mon Sep 17 00:00:00 2001 From: Saito Date: Sat, 25 Aug 2012 15:24:21 +0800 Subject: [PATCH] fix git push body bigger than 112k problem --- config/initializers/grack_auth.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/initializers/grack_auth.rb b/config/initializers/grack_auth.rb index 5995b873..4f77c327 100644 --- a/config/initializers/grack_auth.rb +++ b/config/initializers/grack_auth.rb @@ -42,13 +42,13 @@ module Grack def current_ref if @env["HTTP_CONTENT_ENCODING"] =~ /gzip/ - input = Zlib::GzipReader.new(@request.body).string + input = Zlib::GzipReader.new(@request.body).read else - input = @request.body.string + input = @request.body.read end - - oldrev, newrev, ref = input.split(' ') - /refs\/heads\/([\w-]+)/.match(ref).to_a.last + # Need to reset seek point + @request.body.rewind + /refs\/heads\/([\w-]+)/.match(input).to_a.first end end# Auth end# Grack