Class: Rack::Portarius

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/portarius.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Portarius

Returns a new instance of Portarius.



3
4
5
# File 'lib/rack/portarius.rb', line 3

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



7
8
9
10
# File 'lib/rack/portarius.rb', line 7

def call(env)
  return unauthorized unless env["REMOTE_USER"].nil? || env["REMOTE_USER"] == env["SERVER_NAME"].split(".").first
  @app.call(env)
end