Sha256: 649e5ccacce26df5dc1614aadfe661250036a649f0234b5bacff293098fd598c

Contents?: true

Size: 376 Bytes

Versions: 4

Compression:

Stored size: 376 Bytes

Contents

module CubaApi
  class AllowSessionRack
    def initialize( app, *not_pattern )
      @app = app
      @regexp = /^\/#{not_pattern.join( '|^\/' )}/
    end
    
    def call( env )
      status, headers, resp = @app.call( env )
      if not( env[ 'PATH_INFO' ].match @regexp )
        headers.delete( 'Set-Cookie' )
      end
      [ status, headers, resp ]
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cuba-api-0.6.3 lib/cuba_api/rack/allow_session_rack.rb~
cuba-api-0.6.2 lib/cuba_api/rack/allow_session_rack.rb~
cuba-api-0.6.1 lib/cuba_api/allow_session_rack.rb
cuba-api-0.6.0 lib/cuba_api/allow_session_rack.rb