Closed TeroPihlaja closed 3 years ago
http gem 3.3.0 running on Ruby 3.0.0 seems to be causing FrozenError: can't modify frozen String: "" exception in the following case:
FrozenError: can't modify frozen String: ""
.../gems/http-3.3.0/lib/http/response/body.rb:52:in `force_encoding' .../gems/http-3.3.0/lib/http/response/body.rb:52:in `to_s' .../gems/http-3.3.0/lib/http/response.rb:92:in `flush'
I was checking the reason for this error and it sseems to be caused by the following lines: https://github.com/httprb/http/blob/3-x-stable/lib/http/response/body.rb#L52
@contents = String.new("").force_encoding(@encoding) ... @contents << chunk.force_encoding(@encoding)
Also same pattern repeats in master so I believe that is also affected (but did not test): https://github.com/httprb/http/blob/f4fb3369d030520e981eb891fb5dd25f8e0403d2/lib/http/response/body.rb#L51
Seems to already be fixed in 4.4.1. Closing issue.
http gem 3.3.0 running on Ruby 3.0.0 seems to be causing
FrozenError: can't modify frozen String: ""
exception in the following case:I was checking the reason for this error and it sseems to be caused by the following lines: https://github.com/httprb/http/blob/3-x-stable/lib/http/response/body.rb#L52
Also same pattern repeats in master so I believe that is also affected (but did not test): https://github.com/httprb/http/blob/f4fb3369d030520e981eb891fb5dd25f8e0403d2/lib/http/response/body.rb#L51