—
title: Shrine 3.7.1
New features
-
The
derivation_endpointplugin now supports adding a file extension to the derivation URL path via the:formatoption onUploadedFile#derivation_url. Some HTTP clients and CDNs use the URL path extension to determine the content type of the response.
rb uploaded_file.derivation_url(:thumbnail, format: "jpg") #=> ".../thumbnail/eyJpZCI6ImZvbyIsInN.jpg?signature=..."
The extension is included in the URL signature, so it cannot be tampered with.
-
The
rack_responseplugin now accepts an:etagoption for setting a customETagheader, overriding the default oneShrinegenerates.
rb response = uploaded_file.to_rack_response(etag: "my-custom-etag") response[1]["ETag"] #=> "my-custom-etag"
Bug fixes
-
When initializing
Shrinewith theactiverecordplugin, under Bootsnap 1.24.5 and Ruby 3.4.5 this would raise an error:
ArgumentError: wrong number of arguments (given 2, expected 1; required keyword: plugin)
The seems to be triggered by a special combination of method signatures, where keyword arguments get converted into positional arguments under Bootsnap. To work around this issue, method signatures of some plugin methods have been updated.