—
title: Shrine
2.16.0¶ ↑
New Features¶ ↑
-
The
:download_options
option has been added to thedownload_endpoint
plugin, for specifying options passed toStorage#open
.
rb plugin :download_endpoint, download_options: { sse_customer_algorithm: "AES256", sse_customer_key: "secret_key", sse_customer_key_md5: "secret_key_md5", }
-
The
:upload_open_options
option has been added to thederivation_endpoint
plugin, for specifying options passed toStorage#open
when downloading a cached derivation result.
rb plugin :download_endpoint, upload: true, upload_open_options: { response_content_encoding: "gzip" }
Other improvements¶ ↑
-
The
rack_response
andderivation_endpoint
plugins now don’t return anyContent-Type
response header if the MIME type could not be determined from the file extension. Previously it theContent-Type
header would default toapplication/octet-stream
, which would force the browser to view the file as generic binary content, as opposed to doing its own MIME type sniffing. -
Fixed
delete_raw
plugin breakingderivation_endpoint
when:upload
was enabled. -
Fixed a few things in the
Shrine::Derivation
API: -
Derivation#upload
doesn’t close the input file anymore -
Derivation#upload
now requires input file to respond to#path
-
Derivation#upload
now deletes the internally generated derivation result -
Derivation#processed
now works when derivation result is aFile
object -
The official demo app now shows the
derivation_endpoint
plugin. -
The
#to_rack_response
method from therack_response
plugin now always opens theUploadedFile
, and does so upfront. This means if ther are any download errors, they will bubble up from#to_rack_response
as opposed to when the response body is iterated over. -
When
store_dimensions
plugin was overridingShrine#extract_metadata
, it made the second argument (thecontext
hash) mandatory. This has been fixed, now the second argument is optional again.