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

tld check should be disabled by default #12

Closed
sindresorhus opened this issue Apr 29, 2015 · 7 comments
Closed

tld check should be disabled by default #12

sindresorhus opened this issue Apr 29, 2015 · 7 comments

Comments

@sindresorhus
Copy link
Contributor

Or preferably just removed.

New tld's are coming out all the time and it's not feasible to keep it update to date. Even if you can, people using it won't and it will lead to annoying websites that doesn't accept yo@cat.ninja...

@kevva
Copy link
Owner

kevva commented Apr 29, 2015

This is so we can support URLs without protocols 25050cc. Without it would make this module quite loose, accepting pretty much anything with a . in it. We could make protocols mandatory again though.

@sindresorhus
Copy link
Contributor Author

Alright, I think we need at least an option then. Depending on the use case. If I want to use this regex to find URLs, I want to use the tld list, but only for matching URLs without protocol. Meaning, two patterns in one, one with tld list for only matching schemeless URLs and one without tld list for matching protocol URLs. I also have the use-case of wanting to "validate" and URL, which is kinda the use-case for the exact option. Here I definitely don't want the tld list.

@kevva
Copy link
Owner

kevva commented Apr 29, 2015

Yup, that sounds good to me. So the exact option would need a protocol then, right? I guess we won't need an option if we're just matching two pattterns. One with a protocol and without TLDs and one without a protocol and with TLDs. The exact option would just use the former.

@sindresorhus
Copy link
Contributor Author

So the exact option would need a protocol then, right?

I was asking myself that and not sure. That's why I didn't mention it. I guess so.

Yes to everything else.

@kevva
Copy link
Owner

kevva commented Apr 29, 2015

It's a little weird, because exact is just meant to match the exact string. I wonder if we don't have to introduce a strict option regardless.

@sindresorhus
Copy link
Contributor Author

Hmm, I need to think about that. Let's revisit in a few days.

@kevva
Copy link
Owner

kevva commented Jun 17, 2015

ping @sindresorhus

kevva added a commit that referenced this issue Jun 18, 2015
This essentially means that a protocol is now forced.

Fixes #11 and #12.
@kevva kevva closed this as completed Jun 18, 2015
kevva added a commit that referenced this issue Jun 18, 2015
This essentially means that a protocol is now forced.

Fixes #11 and #12.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants