Skip to content

Commit 66f0ecc

Browse files
authored
Do not dup nonfrozen string on download (#754)
Fixes memory leak on download
1 parent 907accf commit 66f0ecc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/httparty/text_encoder.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class TextEncoder
55
attr_reader :text, :content_type, :assume_utf16_is_big_endian
66

77
def initialize(text, assume_utf16_is_big_endian: true, content_type: nil)
8-
@text = text.dup
8+
@text = +text
99
@content_type = content_type
1010
@assume_utf16_is_big_endian = assume_utf16_is_big_endian
1111
end

0 commit comments

Comments
 (0)