We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
force_encoding
1 parent ffd0ffa commit 0e2e80dCopy full SHA for 0e2e80d
lib/ld-eventsource/impl/buffered_line_reader.rb
@@ -22,8 +22,8 @@ def self.lines_from(chunks)
22
23
Enumerator.new do |gen|
24
chunks.each do |chunk|
25
- chunk.force_encoding("ASCII-8BIT")
26
- buffer << chunk
+ chunk = chunk.dup.force_encoding("ASCII-8BIT")
+ buffer += chunk
27
28
loop do
29
# Search for a line break in any part of the buffer that we haven't yet seen.
0 commit comments