Sha256: 4b6c5ab38d91275f3f22ee99273da6a17e2b8c69c164c3e339d53b6665667bc3
Contents?: true
Size: 543 Bytes
Versions: 42
Compression:
Stored size: 543 Bytes
Contents
module ActionSubscriber module Middleware class Decoder attr_reader :env def initialize(app) @app = app end def call(env) @env = env env.payload = decoder? ? decoder.call(encoded_payload) : encoded_payload.dup @app.call(env) end private def decoder ::ActionSubscriber.config.decoder[env.content_type] end def decoder? decoder.present? end def encoded_payload env.encoded_payload end end end end
Version data entries
42 entries across 42 versions & 1 rubygems