5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 05:26:22 +00:00

fix: fallar al final #16388

This commit is contained in:
f 2024-05-28 15:49:47 -03:00
parent 71e5a01e80
commit 019e679fa9
No known key found for this signature in database

View file

@ -27,17 +27,11 @@ module ActiveStorage
site = Site.find_by_name token[:service_name]
if remote_file?(token)
begin
url = request.body.read
body = Down.download(url, max_size: 111.megabytes)
checksum = Digest::MD5.file(body.path).base64digest
blob.metadata[:url] = url
blob.update_columns checksum: checksum, byte_size: body.size, metadata: blob.metadata
rescue StandardError => e
ExceptionNotifier.notify_exception(e, data: { key: token[:key], url: url, site: site.name })
head :payload_too_large
end
url = request.body.read
body = Down.download(url, max_size: 111.megabytes)
checksum = Digest::MD5.file(body.path).base64digest
blob.metadata[:url] = url
blob.update_columns checksum: checksum, byte_size: body.size, metadata: blob.metadata
else
body = request.body
checksum = token[:checksum]
@ -54,6 +48,10 @@ module ActiveStorage
end
rescue ActiveStorage::IntegrityError
head :unprocessable_entity
rescue Down::Error => e
ExceptionNotifier.notify_exception(e, data: { key: token[:key], url: url, site: site.name })
head :payload_too_large
end
private