2018-02-15 17:41:44 +01:00
|
|
|
# Monkey patch ActiveStorage to make Range query compatible with CleverCloud Cellar
|
|
|
|
#
|
|
|
|
# FIXME : remove when better fix is available
|
2018-02-15 17:03:15 +01:00
|
|
|
ActiveStorage::Identification.class_eval do
|
2018-02-15 17:41:44 +01:00
|
|
|
private
|
|
|
|
|
|
|
|
def identifiable_chunk
|
|
|
|
Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") do |client|
|
|
|
|
client.get(uri, "Range" => "bytes=0-4096").body
|
|
|
|
end
|
2018-02-15 17:03:15 +01:00
|
|
|
end
|
|
|
|
end
|