Set the default User-Agent sent for outgoing http requests.

* Add a `Danbooru.config.http_headers` config option.

* Refactor various places to use this option instead of setting the user
  agent manually.
This commit is contained in:
evazion
2017-07-19 19:37:14 -05:00
parent d48ed95191
commit 8125d8e796
8 changed files with 29 additions and 48 deletions

View File

@@ -14,7 +14,7 @@ module DownloadTestHelper
tempfile = Tempfile.new("danbooru-test")
download = Downloads::File.new(test_source, tempfile.path)
rewritten_source, headers, _ = download.before_download(test_source, {}, {})
rewritten_source, _, _ = download.before_download(test_source, {})
assert_equal(expected_source, rewritten_source, "Tested source URL: #{test_source}")
end