lib/mihari/models/artifact.rb in mihari-3.11.0 vs lib/mihari/models/artifact.rb in mihari-3.12.0

- old
+ new

@@ -1,12 +1,11 @@ # frozen_string_literal: true require "active_record" -require "active_record/filter" require "active_support/core_ext/integer/time" require "active_support/core_ext/numeric/time" -require "uri" +require "addressable/uri" class ArtifactValidator < ActiveModel::Validator def validate(record) return if record.data_type @@ -117,10 +116,10 @@ private def normalize_as_domain(url_or_domain) return url_or_domain if data_type == "domain" - URI.parse(url_or_domain).host + Addressable::URI.parse(url_or_domain).host end def can_enrich_whois? %w[domain url].include?(data_type) && whois_record.nil? end