Skip to content

Ruby 2.7.0 compatibility. #582

Description

@vincentwoo

It seems that after upgrade I am unable to cast an HTTP-rb response to a string:

[4] pry(main)> resp.to_s
/app/vendor/bundle/ruby/2.7.0/gems/pry-0.12.2/lib/pry/exceptions.rb:28: warning: $SAFE will become a normal global variable in Ruby 3.0
FrozenError: can't modify frozen String: ""
from /app/vendor/bundle/ruby/2.7.0/gems/http-4.2.0/lib/http/response/body.rb:52:in `force_encoding'
[5] pry(main)> resp.body.to_s
/app/vendor/bundle/ruby/2.7.0/gems/pry-0.12.2/lib/pry/exceptions.rb:28: warning: $SAFE will become a normal global variable in Ruby 3.0
HTTP::StateError: body is being streamed
from /app/vendor/bundle/ruby/2.7.0/gems/http-4.2.0/lib/http/response/body.rb:45:in `to_s'
[6] pry(main)> resp.class
HTTP::Response < Object
[7] pry(main)> resp.to_s
/app/vendor/bundle/ruby/2.7.0/gems/pry-0.12.2/lib/pry/exceptions.rb:28: warning: $SAFE will become a normal global variable in Ruby 3.0
HTTP::StateError: body is being streamed
from /app/vendor/bundle/ruby/2.7.0/gems/http-4.2.0/lib/http/response/body.rb:45:in `to_s'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions