mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: ensure we can download maxmind without redis or db config
This also corrects FileHelper.download so it supports "follow_redirect" correctly (it used to always follow 1 redirect) and adds a `validate_url` param that will bypass all uri validation if set to false (default is true)
This commit is contained in:
@@ -28,6 +28,7 @@ class FileHelper
|
||||
read_timeout: 5,
|
||||
skip_rate_limit: false,
|
||||
verbose: false,
|
||||
validate_uri: true,
|
||||
retain_on_max_file_size_exceeded: false)
|
||||
|
||||
url = "https:" + url if url.start_with?("//")
|
||||
@@ -37,9 +38,10 @@ class FileHelper
|
||||
|
||||
fd = FinalDestination.new(
|
||||
url,
|
||||
max_redirects: follow_redirect ? 5 : 1,
|
||||
max_redirects: follow_redirect ? 5 : 0,
|
||||
skip_rate_limit: skip_rate_limit,
|
||||
verbose: verbose
|
||||
verbose: verbose,
|
||||
validate_uri: validate_uri
|
||||
)
|
||||
|
||||
fd.get do |response, chunk, uri|
|
||||
|
||||
Reference in New Issue
Block a user