Sha256: e2b678775ddcbc145cc1cf2fc5fa1a4dbd444a5e359cc6ff07dc58ae4c1eb126

Contents?: true

Size: 382 Bytes

Versions: 119

Compression:

Stored size: 382 Bytes

Contents

require 'msgpack'
require 'action_dispatch'

module Acfs
  module Middleware

    # A middleware to encode request data with Message Pack.
    #
    class MessagePackEncoder < Base

      def call(request)
        request.body = ::MessagePack.dump(request.data)
        request.headers['Content-Type'] = 'application/x-msgpack'

        app.call request
      end
    end
  end
end

Version data entries

119 entries across 119 versions & 1 rubygems

Version Path
acfs-0.30.0 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.29.1.1.b259 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.29.1.1.b257 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.29.1 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.29.0.1.b256 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.29.0.1.b254 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.29.0 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.28.0.1.b253 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.28.0.1.b249 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.28.0 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.27.0.1.b248 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.27.0.1.b244 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.27.0 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.26.0.1.b243 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.26.0.1.b242 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.26.0 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.25.0.1.b232 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.25.0.1.b229 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.25.0.1.b228 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.25.0.1.b227 lib/acfs/middleware/msgpack_encoder.rb