Skip to main content

Shrine 3.11.0

Security​

  • FileSystem#delete_prefixed now raises a Shrine::Error when the given prefix resolves outside of the storage directory, the same way other FileSystem methods do. Previously, a prefix such as "../" would cause files outside of the storage directory to be deleted.

Performance improvements​

  • S3#url now builds public URLs with the :host option directly from the object key, without first generating the S3 URL via Aws::S3::Object#public_url. This makes generating such URLs 3-7x faster and significantly reduces allocations.

    s3.url("image.jpg", host: "https://cdn.example.com") # faster

Backwards compatibility​

  • Shrine now requires Ruby 3.3 or later.

  • When using S3 with force_path_style: true and an endpoint whose host contains the bucket name, public URLs generated with :host no longer include the bucket name in the path, consistent with other path-style URLs.