Sha256: 962c945dd77556fe06f07a1f04f3a0b45a7cc08d6a5723e8e809ae012b86b040
Contents?: true
Size: 656 Bytes
Versions: 17
Compression:
Stored size: 656 Bytes
Contents
module Scrivito class BinaryRedirectController < ActionController::Base def to_binary binary = BinaryParamVerifier.verify(params[:encrypted_params]) redirect_to BinaryRewrite.call(request, binary.url), status: 301 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
17 entries across 17 versions & 1 rubygems