このコミットが含まれているのは:
@@ -32,7 +32,9 @@ module Preview
|
||||
def self.fetch_image_response(raw_url)
|
||||
uri, = UrlSafety.validate(raw_url)
|
||||
response = HttpFetcher.fetch(uri.to_s)
|
||||
unless allowed_remote_image_content_type?(response.content_type) || Post.svg_document_bytes?(response.body)
|
||||
unless Post.remote_thumbnail_image_bytes?(
|
||||
response.body,
|
||||
content_type: response.content_type)
|
||||
raise GenerationFailed, 'サムネール画像が見つかりませんでした.'
|
||||
end
|
||||
|
||||
@@ -55,7 +57,9 @@ module Preview
|
||||
return nil if url.blank?
|
||||
|
||||
response = HttpFetcher.fetch(url)
|
||||
return nil unless allowed_remote_image_content_type?(response.content_type)
|
||||
return nil unless Post.remote_thumbnail_image_bytes?(
|
||||
response.body,
|
||||
content_type: response.content_type)
|
||||
|
||||
response.body
|
||||
rescue HttpFetcher::FetchTimeout
|
||||
|
||||
新しい課題から参照
ユーザをブロックする