lib/coach/request_serializer.rb in coach-0.5.2 vs lib/coach/request_serializer.rb in coach-1.0.0
- old
+ new
@@ -6,11 +6,11 @@
# Sets global rules on how to sanitize headers. An optional block can be supplied
# that will determine how to transform the original header value, otherwise a default
# string is used.
def self.sanitize_header(header, &rule)
- header_rules[header] = rule || ->(value) { '[FILTERED]' }
+ header_rules[header] = rule || ->(_value) { "[FILTERED]" }
end
# Applies sanitizing rules. Expects `header` to be in 'http_header_name' form.
def self.apply_header_rule(header, value)
return value if header_rules[header].nil?
@@ -37,18 +37,18 @@
format: @request.format.try(:ref),
params: @request.filtered_parameters, # uses config.filter_parameters
# Extra request info
headers: filtered_headers,
- session_id: @request.remote_ip
+ session_id: @request.remote_ip,
}
end
private
def request_path
@request.fullpath
- rescue
+ rescue StandardError
"unknown"
end
def filtered_headers
header_value_pairs = @request.filtered_env.map do |key, value|