lib/wmap/domain_tracker.rb in wmap-2.4.6 vs lib/wmap/domain_tracker.rb in wmap-2.4.8
- old
+ new
@@ -4,17 +4,17 @@
# A pure Ruby library for the Internet web application discovery and tracking.
#
# Copyright (c) 2012-2015 Yang Li <yang.li@owasp.org>
#++
require "parallel"
-#require "singleton"
+require "singleton"
# Class to track the known (trusted) Internet domains
class Wmap::DomainTracker
include Wmap::Utils
- #include Singleton
+ include Singleton
attr_accessor :verbose, :max_parallel, :domains_file, :file_domains, :data_dir
attr_reader :known_internet_domains
@@ -108,9 +108,10 @@
# 'setter' to add domain entry to the cache one at a time
def add(host)
puts "Add entry to the local domains cache table: #{host}" if @verbose
#begin
+ return nil if host.nil? or host.empty?
host=host.strip.downcase
if @known_internet_domains.key?(host)
puts "Domain is already exist. Skipping: #{host}"
else
root=get_domain_root(host)