2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-05 08:59:27 +08: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:
Sam Saffron 2019-05-28 10:28:57 +10:00
parent e4e2acf148
commit 7429700389
7 changed files with 55 additions and 15 deletions

View file

@ -70,7 +70,8 @@ module ImportScripts::PhpBB3
avatar_file = FileHelper.download(
url,
max_file_size: max_image_size_kb,
tmp_file_name: 'discourse-avatar'
tmp_file_name: 'discourse-avatar',
follow_redirect: true
)
rescue StandardError => err
warn "Error downloading avatar: #{err.message}. Skipping..."