Commit f1c9b058 authored by tsl0922's avatar tsl0922

better fix for encoding error

parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment