提交 f1c9b058 编写于 作者: T tsl0922

better fix for encoding error

上级 4e055e8a
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册