Module: Raven::RackInterface

Included in:
HttpInterface
Defined in:
lib/raven/integrations/rack.rb

Instance Method Summary collapse

Instance Method Details

#from_rack(env_hash) ⇒ Object


70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/raven/integrations/rack.rb', line 70

def from_rack(env_hash)
  req = ::Rack::Request.new(env_hash)

  self.url = req.scheme && req.url.split('?').first
  self.method = req.request_method
  self.query_string = req.query_string
  self.data = read_data_from(req)
  self.cookies = req.cookies

  self.headers = format_headers_for_sentry(env_hash)
  self.env     = format_env_for_sentry(env_hash)
end