Danbooru::Http: fix bug when using proxy option.

Fix external HTTP requests not working when the HTTP proxy was enabled. Caused by the `public_only`
option (which prevents SSRF attacks by validating that the URL doesn't resolve to a local IP) being
incompatible with the `proxy` option.
This commit is contained in:
evazion
2022-11-12 02:39:44 -06:00
parent 215df49050
commit a167091bf9
2 changed files with 11 additions and 1 deletions

View File

@@ -579,6 +579,10 @@ module Danbooru
end
# The proxy to use for outgoing HTTP requests.
#
# If you use a proxy and you're running a public-facing site, you should be careful to configure the proxy to block
# HTTP requests to the local network. That is, block requests to e.g. 127.0.0.1 and 192.168.0.1/24 so that users
# can't upload URLs like `http://192.168.0.1.nip.io/` to trigger HTTP requests to servers inside your local network.
def http_proxy
# "http://username:password@proxy.example.com:1080"
end