Sha256: dcae91ae0ae32972db9c618e4b71d431025b637491376eea425b8ce32c850ed7

Contents?: true

Size: 538 Bytes

Versions: 17

Compression:

Stored size: 538 Bytes

Contents

require "scorpion/rack"

module Shamu
  module Rack

    # Expose a {Cookies} hash to any service that wants to use session specific
    # storage.
    class CookiesMiddleware
      include Scorpion::Rack

      def initialize( app )
        @app = app
      end

      def call( env )
        cookies = Shamu::Rack::Cookies.new( env )
        scorpion( env ).hunt_for Shamu::Rack::Cookies, return: cookies

        status, headers, body = @app.call( env )

        [ status, cookies.apply!( headers ), body ]
      end

    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
shamu-0.0.24 lib/shamu/rack/cookies_middleware.rb
shamu-0.0.21 lib/shamu/rack/cookies_middleware.rb
shamu-0.0.20 lib/shamu/rack/cookies_middleware.rb
shamu-0.0.19 lib/shamu/rack/cookies_middleware.rb
shamu-0.0.18 lib/shamu/rack/cookies_middleware.rb
shamu-0.0.17 lib/shamu/rack/cookies_middleware.rb
shamu-0.0.15 lib/shamu/rack/cookies_middleware.rb
shamu-0.0.14 lib/shamu/rack/cookies_middleware.rb
shamu-0.0.13 lib/shamu/rack/cookies_middleware.rb
shamu-0.0.11 lib/shamu/rack/cookies_middleware.rb
shamu-0.0.9 lib/shamu/rack/cookies_middleware.rb
shamu-0.0.8 lib/shamu/rack/cookies_middleware.rb
shamu-0.0.7 lib/shamu/rack/cookies_middleware.rb
shamu-0.0.5 lib/shamu/rack/cookies_middleware.rb
shamu-0.0.4 lib/shamu/rack/cookies_middleware.rb
shamu-0.0.3 lib/shamu/rack/cookies_middleware.rb
shamu-0.0.2 lib/shamu/rack/cookies_middleware.rb