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:
@@ -20,12 +20,8 @@ module Downloads
|
||||
end
|
||||
|
||||
protected
|
||||
def http_head_request(url, headers)
|
||||
HTTParty.head(url, Danbooru.config.httparty_options.merge(headers: headers))
|
||||
end
|
||||
|
||||
def http_exists?(url, headers)
|
||||
res = http_head_request(url, headers)
|
||||
res = HTTParty.head(url, Danbooru.config.httparty_options.deep_merge(headers: headers))
|
||||
res.success?
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user