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

Please don't parse whole URLs #14

Closed
stevenvachon opened this issue Feb 8, 2017 · 3 comments
Closed

Please don't parse whole URLs #14

stevenvachon opened this issue Feb 8, 2017 · 3 comments

Comments

@stevenvachon
Copy link

stevenvachon commented Feb 8, 2017

Leave that complex process up to Node 7's URL and whatwg-url.

This library is called "parse domain"

@jhnns
Copy link
Member

jhnns commented Dec 21, 2017

Thanks for the feedback.

I know that "parsing" URLs with RegExp is brittle. I used this approach since I didn't want to force browserify/webpack users to include the whole url library. I thought that for the purpose of extracting the domain part using RegExp was sufficient. Can you give me an example where this approach doesn't work?

@jhnns
Copy link
Member

jhnns commented Oct 19, 2018

With the next major version bump, we will just accept instances of the WHATWG URL constructor.

@jhnns jhnns mentioned this issue Nov 8, 2018
jhnns added a commit that referenced this issue Apr 23, 2020
…ements

- Run against [psl example domains](https://raw.githubusercontent.com/publicsuffix/list/master/tests/test_psl.txt). Closes #1
- Add support for international domain names. Fixes #16 #82 and #44
- Only accept hostnames instead of whole URLs. Fixes #49 and #14
- Do not auto update tries on npm install. Fixes #42 #48 and #90
- Use "node-fetch" instead of "got". Fixes #78 and #62
- Use Node's "assert" module instead of Jest for smoke test. Fixes #92 #93 #89 #91
- Recognize IPv4 and IPv6 in hostnames. Fixes #102

BREAKING CHANGE: This release is a complete rewrite in TypeScript. It fixes some long outstanding bugs and comes with improvements we were planning for quite some time. The major changes are: 1. parseDomain does not accept whole URLs anymore. Only the hostname section of a URL is allowed now. 2. We removed the options object. Custom TLDs are returned as "valid but not listed". The parse result contains both the result with private TLDs and without private TLDs. 3. Dropped Node 6 support. We recommend reading the README since the public API as changed quite a lot.
@jhnns
Copy link
Member

jhnns commented Apr 23, 2020

Fixed with v3.0.0 🚀

@jhnns jhnns closed this as completed Apr 23, 2020
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