summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authortsl0922 <tsl0922@gmail.com>2013-05-03 11:31:23 +0800
committertsl0922 <tsl0922@gmail.com>2013-05-03 11:31:23 +0800
commitf1c9b05868cb6ecc72c1dc6f7de0583ca7f95faa (patch)
tree8c60e7f6cedef86c3dc16ab708c64021539afbd9 /lib
parent4e055e8a631ead1e8556287866e7a55f4a97062d (diff)
downloadgitlab-ce-f1c9b05868cb6ecc72c1dc6f7de0583ca7f95faa.tar.gz
better fix for encoding error
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/backend/grack_auth.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/gitlab/backend/grack_auth.rb b/lib/gitlab/backend/grack_auth.rb
index 6d87df17e75..6a411aabcc6 100644
--- a/lib/gitlab/backend/grack_auth.rb
+++ b/lib/gitlab/backend/grack_auth.rb
@@ -109,11 +109,9 @@ module Grack
else
input = @request.body.read
end
- # force utf-8 encoding
- input.encode!('UTF-8', 'UTF-8', invalid: :replace, undef: :replace, replace: '')
# Need to reset seek point
@request.body.rewind
- /refs\/heads\/([\w\.-]+)/.match(input).to_a.last
+ /refs\/heads\/([\w\.-]+)/n.match(input.force_encoding('ascii-8bit')).to_a.last
end
def project