Commit f1c9b05868cb6ecc72c1dc6f7de0583ca7f95faa
1 parent
4e055e8a
Exists in
master
and in
4 other branches
better fix for encoding error
Showing
1 changed file
with
1 additions
and
3 deletions
Show diff stats
lib/gitlab/backend/grack_auth.rb
@@ -109,11 +109,9 @@ module Grack | @@ -109,11 +109,9 @@ module Grack | ||
109 | else | 109 | else |
110 | input = @request.body.read | 110 | input = @request.body.read |
111 | end | 111 | end |
112 | - # force utf-8 encoding | ||
113 | - input.encode!('UTF-8', 'UTF-8', invalid: :replace, undef: :replace, replace: '') | ||
114 | # Need to reset seek point | 112 | # Need to reset seek point |
115 | @request.body.rewind | 113 | @request.body.rewind |
116 | - /refs\/heads\/([\w\.-]+)/.match(input).to_a.last | 114 | + /refs\/heads\/([\w\.-]+)/n.match(input.force_encoding('ascii-8bit')).to_a.last |
117 | end | 115 | end |
118 | 116 | ||
119 | def project | 117 | def project |