use force_https site setting when adding scheme for downloading schemaless images locally

This commit is contained in:
Régis Hanol 2017-10-12 00:06:24 +02:00
parent 4e78abb537
commit f7282e4ecd

View File

@ -50,7 +50,9 @@ module Jobs
extract_images_from(post.cooked).each do |image|
src = original_src = image['src']
src = "http:#{src}" if src.start_with?("//")
if src.start_with?("//")
src = "#{SiteSetting.force_https ? "https" : "http"}:#{src}"
end
if is_valid_image_url(src)
begin