twingly/twingly-url

Hostnames like `foo.local` are considered invalid

futuretap opened this issue · 1 comments

That breaks development workflows.

walro commented

Thanks for reporting, I'd say this is expected behavior though as we use "strict validation" (see https://github.com/twingly/twingly-url/blob/v6.0.3/lib/twingly/url.rb#L70-L71), a slimmer example:

# with strict validation mode
[3] pry(main)> PublicSuffix.valid?("foo.local", default_rule: nil)
=> false
# without strict validation
[4] pry(main)> PublicSuffix.valid?("foo.local")
=> true

Internally we use this gem mainly to validate (and normalize) "real" URLs, so for us it makes sense to use strict validation. However, we're open for a PR which makes the strictness configurable.