lib/url_canonicalize/uri.rb in url_canonicalize-0.2.1 vs lib/url_canonicalize/uri.rb in url_canonicalize-1.0.0
- old
+ new
@@ -16,9 +16,10 @@
private
def valid?(uri)
raise URLCanonicalize::Exception::URI, "#{uri} must be http or https" unless VALID_CLASSES.include?(uri.class)
raise URLCanonicalize::Exception::URI, "Missing host name in #{uri}" unless uri.host
+ raise URLCanonicalize::Exception::URI, "Empty host name in #{uri}" if uri.host.empty?
true
end
def decorate(url)