Fix Error 500s due to encoding issues when Wiki hooks fire
Saved Wiki content goes through the GitalyClient::WikiService
, which calls
StringIO#set_encoding
on the input stream. The problem is that this call
mutates the encoding of the given string object to ASCII-88BIT, which
causes problems for models expecting the data to still be in UTF-8.
Freezing the input disables this behavior: https://github.com/ruby/ruby/blob/v2_4_4/ext/stringio/stringio.c#L1583
Stack Overflow issue: https://stackoverflow.com/questions/48156725/stringio-instance-mutating-original-string
Closes #50590 (closed)
Edited by Stan Hu