lib/contrast/agent/reporting/reporting_utilities/build_preflight.rb in contrast-agent-6.6.5 vs lib/contrast/agent/reporting/reporting_utilities/build_preflight.rb in contrast-agent-6.7.0
- old
+ new
@@ -12,20 +12,17 @@
# This module will handle the building of new preflights prior to
# sending them.
module BuildPreflight
class << self
# @param finding [Contrast::Agent::Reporting::Finding]
- # @param request [Contrast::Agent::Request] current request
- def build finding, request
+ # @return [Contrast::Agent::Reporting::Preflight, nil]
+ def generate finding
return unless finding
- # save the current finding
- Contrast::Agent::Reporting::ReportingStorage[finding.hash_code] = finding
-
new_preflight = Contrast::Agent::Reporting::Preflight.new
new_preflight_message = Contrast::Agent::Reporting::PreflightMessage.new
- if request&.route
- new_preflight_message.routes << Contrast::Agent::Reporting::RouteDiscovery.convert(request.route)
+ finding.routes.each do |route|
+ new_preflight_message.routes << route
end
new_preflight_message.hash_code = finding.hash_code
new_preflight_message.data = "#{ finding.rule_id },#{ finding.hash_code }"
new_preflight.messages << new_preflight_message
new_preflight