このコミットが含まれているのは:
2026-07-18 11:55:09 +09:00
コミット b3e67d8cca
4個のファイルの変更70行の追加7行の削除
+6 -2
ファイルの表示
@@ -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