sparklemotion/mechanize — pull request #360 by JonRowe (2014-01-06 23:36:05+00:00)
Title: Fix obfuscation of error in handling invalid gzip responses.

I have a gzip response that invalidly reports a `NoMethodError` due to the
`ensure` clause attempting to compare path of nil with the body. This protects
against this by not attempting to close body if we don't have an output.

For reference the error is a `Zlib::BufError` being raised thusly:

```
/lib/mechanize/http/agent.rb:1181:in `finish'
/lib/mechanize/http/agent.rb:1181:in `inflate'
/lib/mechanize/http/agent.rb:439:in `rescue in content_encoding_gunzip'
/lib/mechanize/http/agent.rb:448:in `content_encoding_gunzip'
/lib/mechanize/http/agent.rb:814:in `response_content_encoding'
/lib/mechanize/http/agent.rb:275:in `fetch'
/lib/mechanize.rb:440:in `get'
```