Skip to content

Instantly share code, notes, and snippets.

@cmorss
Last active June 30, 2016 19:04
Show Gist options
  • Save cmorss/533c983288693f05ab32429166527550 to your computer and use it in GitHub Desktop.
Save cmorss/533c983288693f05ab32429166527550 to your computer and use it in GitHub Desktop.
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.headers = format_headers_for_sentry(env_hash)
self.env = format_env_for_sentry(env_hash)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment