Commit 4e055e8a631ead1e8556287866e7a55f4a97062d
1 parent
ef61d1f2
Exists in
master
and in
4 other branches
fix: UTF-8 encoding error
Showing
1 changed file
with
2 additions
and
0 deletions
Show diff stats
lib/gitlab/backend/grack_auth.rb
@@ -109,6 +109,8 @@ module Grack | @@ -109,6 +109,8 @@ 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: '') | ||
112 | # Need to reset seek point | 114 | # Need to reset seek point |
113 | @request.body.rewind | 115 | @request.body.rewind |
114 | /refs\/heads\/([\w\.-]+)/.match(input).to_a.last | 116 | /refs\/heads\/([\w\.-]+)/.match(input).to_a.last |