Class: Sinatra::Request
- Inherits:
-
Object
- Object
- Sinatra::Request
- Defined in:
- lib/logjam_agent/rack/sinatra_request.rb
Overview
Extend the Sinatra Request class with some methods to make it look more like an ActionDispatch request.
Constant Summary collapse
Instance Method Summary collapse
- #filtered_path ⇒ Object
- #parameter_filter ⇒ Object
- #query_parameters ⇒ Object
- #request_parameters ⇒ Object
Instance Method Details
#filtered_path ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/logjam_agent/rack/sinatra_request.rb', line 23 def filtered_path return path if query_string.empty? filter = parameter_filter filtered_query_string = query_string.gsub(PAIR_RE) do |_| filter.filter($1 => $2).first.join("=") end "#{path}?#{filtered_query_string}" end |
#parameter_filter ⇒ Object
16 17 18 |
# File 'lib/logjam_agent/rack/sinatra_request.rb', line 16 def parameter_filter ActiveSupport::ParameterFilter.new(LogjamAgent.parameter_filters) end |
#query_parameters ⇒ Object
13 |
# File 'lib/logjam_agent/rack/sinatra_request.rb', line 13 def query_parameters; self.GET; end |
#request_parameters ⇒ Object
14 |
# File 'lib/logjam_agent/rack/sinatra_request.rb', line 14 def request_parameters; self.POST; end |