urbanadventurer / WhatWeb

Next generation web scanner

Home Page:https://www.morningstarsecurity.com/research/whatweb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TODO: lib/whatweb/scan: print something more useful

bcoles opened this issue · comments

         # is it a valid domain?
          begin
            domain = Addressable::URI.parse(x)
            # check validity
            raise 'Unable to parse invalid target. No hostname.' if domain.host.empty?

            # convert IDN domain
            x = domain.normalize.to_s if domain.host !~ %r{^[a-zA-Z0-9\.:\/]*$}
          rescue => e
            # if it fails it's not valid
            x = nil
            # TODO: print something more useful
            error("Unable to parse invalid target #{x}: #{e}")
          end