Sha256: ce208089ad8b921693d5abc520709ce7a2e78be98d35ad281c91b661dbcd97d9
Contents?: true
Size: 643 Bytes
Versions: 16
Compression:
Stored size: 643 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.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
16 entries across 16 versions & 1 rubygems