class CubaApi::Rack::AllowSessionRack

Public Class Methods

new( app, *not_pattern ) click to toggle source
# File lib/cuba_api/rack/allow_session_rack.rb, line 4
def initialize( app, *not_pattern )
  @app = app
  @regexp = /^\/#{not_pattern.join( '|^\/' )}/
end

Public Instance Methods

call( env ) click to toggle source
# File lib/cuba_api/rack/allow_session_rack.rb, line 9
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