Class: Sentry::RequestInterface
- Defined in:
- lib/sentry/interfaces/request.rb
Constant Summary collapse
- REQUEST_ID_HEADERS =
%w[action_dispatch.request_id HTTP_X_REQUEST_ID].freeze
- CONTENT_HEADERS =
%w[CONTENT_TYPE CONTENT_LENGTH].freeze
- IP_HEADERS =
[ "REMOTE_ADDR", "HTTP_CLIENT_IP", "HTTP_X_REAL_IP", "HTTP_X_FORWARDED_FOR" ].freeze
- MAX_BODY_LIMIT =
See Sentry server default limits at github.com/getsentry/sentry/blob/master/src/sentry/conf/server.py
4096 * 4
Instance Attribute Summary collapse
- #cookies ⇒ String
- #data ⇒ Hash
- #env ⇒ Hash
- #headers ⇒ Hash
- #method ⇒ String
- #query_string ⇒ String
- #url ⇒ String
Instance Method Summary collapse
-
#initialize(env:, send_default_pii:, rack_env_whitelist:) ⇒ RequestInterface
constructor
A new instance of RequestInterface.
Methods inherited from Interface
Constructor Details
#initialize(env:, send_default_pii:, rack_env_whitelist:) ⇒ RequestInterface
Returns a new instance of RequestInterface.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/sentry/interfaces/request.rb', line 44 def initialize(env:, send_default_pii:, rack_env_whitelist:) env = env.dup unless send_default_pii # need to completely wipe out ip addresses RequestInterface::IP_HEADERS.each do |header| env.delete(header) end end request = ::Rack::Request.new(env) if send_default_pii self.data = read_data_from(request) self. = request. self.query_string = request.query_string end self.url = request.scheme && request.url.split("?").first self.method = request.request_method self.headers = filter_and_format_headers(env, send_default_pii) self.env = filter_and_format_env(env, rack_env_whitelist) end |
Instance Attribute Details
#cookies ⇒ String
31 32 33 |
# File 'lib/sentry/interfaces/request.rb', line 31 def @cookies end |
#data ⇒ Hash
25 26 27 |
# File 'lib/sentry/interfaces/request.rb', line 25 def data @data end |
#env ⇒ Hash
37 38 39 |
# File 'lib/sentry/interfaces/request.rb', line 37 def env @env end |
#headers ⇒ Hash
34 35 36 |
# File 'lib/sentry/interfaces/request.rb', line 34 def headers @headers end |
#method ⇒ String
22 23 24 |
# File 'lib/sentry/interfaces/request.rb', line 22 def method @method end |
#query_string ⇒ String
28 29 30 |
# File 'lib/sentry/interfaces/request.rb', line 28 def query_string @query_string end |
#url ⇒ String
19 20 21 |
# File 'lib/sentry/interfaces/request.rb', line 19 def url @url end |