Sha256: 8b5e509cc9e867ddd1b6544e67bec8d10f1824fb273c60ce773b3e21e79277ac

Contents?: true

Size: 614 Bytes

Versions: 23

Compression:

Stored size: 614 Bytes

Contents

module Timber
  module Integrations
    module Rack
      # Reponsible for adding the HTTP context for applications that use `Rack`.
      class HTTPContext
        def initialize(app)
          @app = app
        end

        def call(env)
          request = Util::Request.new(env)
          context = Contexts::HTTP.new(
            method: request.request_method,
            path: request.path,
            remote_addr: request.ip,
            request_id: request.request_id
          )
          CurrentContext.with(context) do
            @app.call(env)
          end
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
timber-2.0.24 lib/timber/integrations/rack/http_context.rb
timber-2.0.23 lib/timber/integrations/rack/http_context.rb
timber-2.0.22 lib/timber/integrations/rack/http_context.rb
timber-2.0.21 lib/timber/integrations/rack/http_context.rb
timber-2.0.20 lib/timber/integrations/rack/http_context.rb
timber-2.0.19 lib/timber/integrations/rack/http_context.rb
timber-2.0.17 lib/timber/integrations/rack/http_context.rb
timber-2.0.16 lib/timber/integrations/rack/http_context.rb
timber-2.0.15 lib/timber/integrations/rack/http_context.rb
timber-2.0.14 lib/timber/integrations/rack/http_context.rb
timber-2.0.12 lib/timber/integrations/rack/http_context.rb
timber-2.0.11 lib/timber/integrations/rack/http_context.rb
timber-2.0.10 lib/timber/integrations/rack/http_context.rb
timber-2.0.9 lib/timber/integrations/rack/http_context.rb
timber-2.0.8 lib/timber/integrations/rack/http_context.rb
timber-2.0.7 lib/timber/integrations/rack/http_context.rb
timber-2.0.6 lib/timber/integrations/rack/http_context.rb
timber-2.0.5 lib/timber/integrations/rack/http_context.rb
timber-2.0.4 lib/timber/integrations/rack/http_context.rb
timber-2.0.3 lib/timber/integrations/rack/http_context.rb