Sha256: 61c140cbba4e612c221cbe5de34146e234a2fae7d08aa4510e56ed77f4cc10d4
Contents?: true
Size: 590 Bytes
Versions: 115
Compression:
Stored size: 590 Bytes
Contents
require 'msgpack' require 'action_dispatch' module Acfs module Middleware # Register msgpack mime type ::Mime::Type.register 'application/x-msgpack', :msgpack # A middleware to decode Message Pack responses. # class MessagePackDecoder < Base CONTENT_TYPES = %w(application/x-msgpack) def response(response, nxt) response.data = ::MessagePack.unpack(response.body) if message_pack?(response) nxt.call response end def message_pack?(response) CONTENT_TYPES.include? response.content_type end end end end
Version data entries
115 entries across 115 versions & 1 rubygems