Shrine 2.16.0
New Features
The
:download_optionsoption has been added to thedownload_endpointplugin, for specifying options passed toStorage#open.plugin :download_endpoint, download_options: { sse_customer_algorithm: "AES256", sse_customer_key: "secret_key", sse_customer_key_md5: "secret_key_md5", }The
:upload_open_optionsoption has been added to thederivation_endpointplugin, for specifying options passed toStorage#openwhen downloading a cached derivation result.plugin :download_endpoint, upload: true, upload_open_options: { response_content_encoding: "gzip" }
Other improvements
The
rack_responseandderivation_endpointplugins now don't return anyContent-Typeresponse header if the MIME type could not be determined from the file extension. Previously it theContent-Typeheader 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_rawplugin breakingderivation_endpointwhen:uploadwas enabled.Fixed a few things in the
Shrine::DerivationAPI:Derivation#uploaddoesn't close the input file anymoreDerivation#uploadnow requires input file to respond to#pathDerivation#uploadnow deletes the internally generated derivation resultDerivation#processednow works when derivation result is aFileobject
The official demo app now shows the
derivation_endpointplugin.The
#to_rack_responsemethod from therack_responseplugin now always opens theUploadedFile, and does so upfront. This means if ther are any download errors, they will bubble up from#to_rack_responseas opposed to when the response body is iterated over.When
store_dimensionsplugin was overridingShrine#extract_metadata, it made the second argument (thecontexthash) mandatory. This has been fixed, now the second argument is optional again.