Sha256: d5f546d4b1872578df43436d73d0058bd3d2974a7d10cea214c7822460207430
Contents?: true
Size: 511 Bytes
Versions: 3
Compression:
Stored size: 511 Bytes
Contents
# inspired by hoptoad_notifier # http://charlesmaxwood.com/sessions-in-rack-and-rails-metal/ module Honeypot # Middleware for Rack applications. Remote hosts will be tied together with remote requests. class Rack def initialize(app) @app = app end def call(env) session = env['rack.session'] remote_ip = IPAddr.new env['action_dispatch.remote_ip'].to_s session['honeypot.last_known_remote_ip'] = remote_ip.to_s if remote_ip.public? @app.call env end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
honeypot-0.0.4 | lib/honeypot/rack.rb |
honeypot-0.0.3 | lib/honeypot/rack.rb |
honeypot-0.0.2 | lib/honeypot/rack.rb |