For those who have a problem with code that runs on ruby ââ1.9 and does not work when upgrading to ruby ââ2.0, just include this code in your project.
module HTTPResponseDecodeContentOverride def initialize(h,c,m) super(h,c,m) @decode_content = true end def body res = super if self['content-length'] self['content-length']= res.bytesize end res end end module Net class HTTPResponse prepend HTTPResponseDecodeContentOverride end end
source share