4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/gricer/parsers/request.rb', line 4
def self.get_info(request)
info = {}
info[:ip_address] = request.remote_ip
info[:agent_header] = request.['HTTP_USER_AGENT']
info[:referer] = request.['HTTP_X_FORWARDED_REFERER'] || request.['HTTP_REFERER']
info[:host] = request.host
info[:path] = request.path
info[:method] = request.request_method
info[:protocol] = request.protocol.sub(/[:\/]*$/, '').upcase
info[:locale] = I18n.locale
info[:req_locale] = " #{request.['HTTP_ACCEPT_LANGUAGE']} "
.match(/[^A-Za-z1-9]([A-Za-z]{2}(-[A-Za-z]{2})?)[^A-Za-z1-9]/)
.to_a[1]
return info
end
|