Class: HttpLog::HttpRequest

Inherits:
Rack::Request
  • Object
show all
Defined in:
lib/http_log/http_request.rb

Instance Method Summary collapse

Instance Method Details

#acceptsObject



3
4
5
# File 'lib/http_log/http_request.rb', line 3

def accepts
  Array.wrap(super).map(&:to_s)
end

#header_hashObject



7
8
9
10
11
12
13
14
# File 'lib/http_log/http_request.rb', line 7

def header_hash
  header_keys = env.keys.select {|k| k =~ /HTTP_\w+/ }
  hash = {}
  header_keys.each do |key|
    hash[key] = env[key]
  end
  hash
end

#paramsObject



26
27
28
# File 'lib/http_log/http_request.rb', line 26

def params
  super.merge(env['action_dispatch.request.request_parameters'] || {})
end

#raw_postObject



20
21
22
23
24
# File 'lib/http_log/http_request.rb', line 20

def raw_post
  content = env['rack.input'].read
  env['rack.input'].rewind
  content
end