Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hostnames like foo.local are considered invalid #147

Open
futuretap opened this issue Nov 5, 2020 · 1 comment
Open

Hostnames like foo.local are considered invalid #147

futuretap opened this issue Nov 5, 2020 · 1 comment

Comments

@futuretap
Copy link

That breaks development workflows.

@walro
Copy link
Contributor

walro commented Nov 5, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants