You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In versions >= 0.15.0 when I do something like HTTParty.head("https://www.google.com"), it fails with this Callstack:
NoMethodError: undefined method `force_encoding' for nil:NilClass
from /Users/peter/.rvm/gems/ruby-2.3.3@ptcshell/gems/httparty-0.15.0/lib/httparty/request.rb:280:in `encode_with_ruby_encoding'
from /Users/peter/.rvm/gems/ruby-2.3.3@ptcshell/gems/httparty-0.15.0/lib/httparty/request.rb:316:in `_encode_body'
from /Users/peter/.rvm/gems/ruby-2.3.3@ptcshell/gems/httparty-0.15.0/lib/httparty/request.rb:322:in `encode_body'
from /Users/peter/.rvm/gems/ruby-2.3.3@ptcshell/gems/httparty-0.15.0/lib/httparty/request.rb:350:in `handle_response'
from /Users/peter/.rvm/gems/ruby-2.3.3@ptcshell/gems/httparty-0.15.0/lib/httparty/request.rb:158:in `perform'
from /Users/peter/.rvm/gems/ruby-2.3.3@ptcshell/gems/httparty-0.15.0/lib/httparty/request.rb:347:in `handle_response'
from /Users/peter/.rvm/gems/ruby-2.3.3@ptcshell/gems/httparty-0.15.0/lib/httparty/request.rb:158:in `perform'
from /Users/peter/.rvm/gems/ruby-2.3.3@ptcshell/gems/httparty-0.15.0/lib/httparty.rb:563:in `perform_request'
from /Users/peter/.rvm/gems/ruby-2.3.3@ptcshell/gems/httparty-0.15.0/lib/httparty.rb:536:in `head'
from /Users/peter/.rvm/gems/ruby-2.3.3@ptcshell/gems/httparty-0.15.0/lib/httparty.rb:629:in `head'
It works as expected in version 0.14.0. I'm fairly certain that it is caused by one of the changes in this PR: #513
Specifically number 6 in that list. When I understand correctly, the body that gets passed to #encode_with_ruby_encoding should be nil for most HEAD requests. In earlier versions, the NoMethodError was rescued and the unmodified body (i.e. nil) returned. So this is the commit that broke it: c46663d
I'll provide a PR for this very soon.
The text was updated successfully, but these errors were encountered:
In versions >= 0.15.0 when I do something like
HTTParty.head("https://www.google.com")
, it fails with this Callstack:It works as expected in version 0.14.0. I'm fairly certain that it is caused by one of the changes in this PR: #513
Specifically number 6 in that list. When I understand correctly, the body that gets passed to
#encode_with_ruby_encoding
should be nil for most HEAD requests. In earlier versions, the NoMethodError was rescued and the unmodified body (i.e. nil) returned. So this is the commit that broke it: c46663dI'll provide a PR for this very soon.
The text was updated successfully, but these errors were encountered: