sparklemotion/mechanize — pull request #318 by burninggramma (2013-06-08 23:22:26+00:00)
Title: Fix emptystring filename header

I was parsing some youtube pages and got into this issue that sometimes the response object for the Parser looks like this:

{"access-control-allow-origin"=>"*",
"etag"=>"\"v0\"",
"expires"=>"Sun, 09 Jun 2013 22:53:27 GMT",
"cache-control"=>"public, max-age=86400, no-transform",
"content-disposition"=>"inline;filename=\"\"",
"content-type"=>"image/png",
"x-content-type-options"=>"nosniff",
"date"=>"Sat, 08 Jun 2013 22:53:27 GMT",
"server"=>"fife",
"content-length"=>"1667",
"x-xss-protection"=>"1; mode=block"}

This results an exception inside .extract_filename for the parser object.

I've added a test case as well, so you can see that it failes with the current implementation. Not sure if this is the right solution but for me it works.