phinze/homebrew-cask — pull request #1944 by jonahoffline (2013-12-05 20:01:48+00:00)
Title: Add DownloadStrategy with custom :headers support

This adds support for overriding the default UserAgent that curl adds by default and also accepts a :cookies hash.
@NanoXD - #1175 called for a DownloadStrategy with UserAgent support to avoid problems related to 403's / Spam in Detection like #984, but after seeing so many brackets pull-requests that fail and a few issues related to being limited by the original `CurlDownloadStrategy`; I think it would be good to incorporate a simple headers option that can be extended as needed.

A few examples:
```ruby
headers :user_agent => 'Netscape/1.0'
headers :user_agent => 'Lynx/1.7', :cookies => { :cookey => "r00t", :cookey2 => "k4w411" }
headers :cookies => { :cookey => "r00t" }
```

For a simple UserAgent, you can use the standalone :fake_user_agent that impersonates Chrome.
```ruby
fake_user_agent
```
The :cookies option is based on #958
which has been sitting for 2 months with no answer from the author so I went ahead and did some small changes and used it.

References #1175