Sha256: ed47ec3f2371cb7fd2264d0ae2b918bb7505fc43fc9d75969c1794e841a43190
Contents?: true
Size: 727 Bytes
Versions: 66
Compression:
Stored size: 727 Bytes
Contents
module Scrivito class BinaryRedirectController < ActionController::Base def to_binary binary = BinaryParamVerifier.verify(params[:encrypted_params]) redirect_to BinaryRewrite.call(request, binary.url) rescue BinaryParamVerifier::InvalidSignature head :precondition_failed rescue TransformationSourceError => error case error.code when /transform.source.type_invalid/ then render_error('source_type_invalid') when /transform.source.too_large/ then render_error('source_too_large') else render_error('source_invalid') end end private def render_error(error_name) redirect_to view_context.image_path("scrivito/#{error_name}.png") end end end
Version data entries
66 entries across 66 versions & 1 rubygems