class
MartenRailsBridge::ActiveStorage::Blobs::RedirectHandler
- MartenRailsBridge::ActiveStorage::Blobs::RedirectHandler
- Marten::Handlers::Base
- Reference
- Object
Overview
Turns a signed permanent reference for a blob into an expiring service URL for download.
Mount it on the route Rails uses, so that URLs issued by a Rails app keep resolving:
path "/rails/active_storage/blobs/redirect/<signed_id:str>/<filename:path>",
MartenRailsBridge::ActiveStorage::Blobs::RedirectHandler,
name: "active_storage_blob"
The filename route parameter only shapes the URL: the filename served to the client comes
from the blob itself.
WARNING like in Rails, this handler is publicly accessible. The signed IDs are hard to guess but permanent by design. https://github.com/rails/rails/blob/v8.1.3/activestorage/app/controllers/active_storage/blobs/redirect_controller.rb
Direct Known Subclasses
- MartenRailsBridge::ActiveStorage::Blobs::RedirectHandlerGuardTest::AdminOnlyHandler
- MartenRailsBridge::ActiveStorage::Blobs::RedirectHandlerGuardTest::GuardedHandler
- MartenRailsBridge::ActiveStorage::Blobs::RedirectHandlerGuardTest::WidenedHandler
Defined in:
active_storage/blobs/redirect_handler.crInstance Method Summary
-
#get
Handles a
GETHTTP request and returns aMarten::HTTP::Responseobject.
Instance Method Detail
def get
#
Description copied from class Marten::Handlers::Base
Handles a GET HTTP request and returns a Marten::HTTP::Response object.
The default implementation will return a 405 (not allowed) response.