request_context.rb 311 Bytes EditWeb IDE 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 module Gitlab class RequestContext class << self def client_ip RequestStore[:client_ip] end end def initialize(app) @app = app end def call(env) req = Rack::Request.new(env) RequestStore[:client_ip] = req.ip @app.call(env) end end end