Class: GrapeLogging::Loggers::RequestHeaders
- Defined in:
- lib/grape_logging/loggers/request_headers.rb
Constant Summary collapse
- HTTP_PREFIX =
'HTTP_'.freeze
Instance Method Summary collapse
Instance Method Details
#parameters(request, _) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/grape_logging/loggers/request_headers.rb', line 7 def parameters(request, _) headers = {} request.env.each_pair do |k, v| next unless k.to_s.start_with? HTTP_PREFIX k = k[5..-1].split('_').each(&:capitalize!).join('-') headers[k] = v end { headers: headers } end |