Add HTTP proxy support.
Add support for using a proxy for HTTP requests. Only used for external requests, such as downloading files or talking to source sites such as Pixiv or Twitter, not for internal requests, such as talking to IQDB or Reportbooru.
This commit is contained in:
@@ -231,7 +231,7 @@ module Sources
|
||||
|
||||
# A http client for API requests.
|
||||
def http
|
||||
Danbooru::Http.new.public_only
|
||||
Danbooru::Http.new.proxy.public_only
|
||||
end
|
||||
memoize :http
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@ module Sources
|
||||
end
|
||||
|
||||
def api_client
|
||||
PixivAjaxClient.new(Danbooru.config.pixiv_phpsessid)
|
||||
PixivAjaxClient.new(Danbooru.config.pixiv_phpsessid, http: http)
|
||||
end
|
||||
|
||||
def api_illust
|
||||
|
||||
Reference in New Issue
Block a user