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.40.1.rc1 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.40.0 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.39.1 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.39.0 lib/acfs/middleware/msgpack_encoder.rb
acfs-1.0.0.dev.1.b305 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.38.0 lib/acfs/middleware/msgpack_encoder.rb
acfs-1.0.0.dev.1.b298 lib/acfs/middleware/msgpack_encoder.rb
acfs-1.0.0.dev.1.b297 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.37.0.1.b295 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.37.0 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.36.0.1.b293 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.36.0 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.35.0.1.b291 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.35.0 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.34.1.1.b289 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.34.1 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.34.0.1.b288 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.34.0.1.b287 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.34.0.1.b286 lib/acfs/middleware/msgpack_encoder.rb
acfs-0.34.0 lib/acfs/middleware/msgpack_encoder.rb