Skip to content

Commit

Permalink
Merge pull request #10 from lmullen/204-no-body
Browse files Browse the repository at this point in the history
Fix error when receiving code 204
  • Loading branch information
treeder committed Aug 4, 2013
2 parents c17f29a + b1414d0 commit 2790dc5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/rest/wrappers/net_http_persistent_wrapper.rb
Expand Up @@ -16,10 +16,16 @@ def initialize(response)

if response.header['content-encoding'].eql?('gzip')
Rest.logger.debug 'GZIPPED'
sio = StringIO.new(response.body)
gz = Zlib::GzipReader.new(sio)
page = gz.read()
@body = page

if response.body
sio = StringIO.new(response.body)
gz = Zlib::GzipReader.new(sio)
page = gz.read()
@body = page
else
@body = nil
end

end
end

Expand Down

0 comments on commit 2790dc5

Please sign in to comment.