2.16.0.md

doc/release_notes/2.16.0.md
Last Update: 2023-07-30 18:26:06 +0200

title: Shrine 2.16.0

New Features

  • The :download_options option has been added to the download_endpoint plugin, for specifying options passed to Storage#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 the derivation_endpoint plugin, for specifying options passed to Storage#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 and derivation_endpoint plugins now don’t return any Content-Type response header if the MIME type could not be determined from the file extension. Previously it the Content-Type header would default to application/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 breaking derivation_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 a File object

  • The official demo app now shows the derivation_endpoint plugin.

  • The #to_rack_response method from the rack_response plugin now always opens the UploadedFile, 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 overriding Shrine#extract_metadata, it made the second argument (the context hash) mandatory. This has been fixed, now the second argument is optional again.