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

IPv6 URL's not parsed correctly, however IPv4 are #114

Closed
niftylettuce opened this issue Aug 20, 2020 · 2 comments
Closed

IPv6 URL's not parsed correctly, however IPv4 are #114

niftylettuce opened this issue Aug 20, 2020 · 2 comments
Labels

Comments

@niftylettuce
Copy link

❯ node
Welcome to Node.js v12.18.0.
Type ".help" for more information.
> const { fromUrl, NO_HOSTNAME } = require('parse-domain');
undefined
> fromUrl('1.2.3.4/host')
'1.2.3.4'
> fromUrl('::af/host')
Symbol(NO_HOSTNAME)
> fromUrl('1234:1234:123:21::21/host')
Symbol(NO_HOSTNAME)
>
niftylettuce added a commit to spamscanner/spamscanner that referenced this issue Aug 20, 2020
niftylettuce added a commit to spamscanner/spamscanner that referenced this issue Aug 21, 2020
@jhnns jhnns closed this as completed in b32d16c Jan 23, 2022
github-actions bot pushed a commit that referenced this issue Jan 23, 2022
# [7.0.0](v6.0.1...v7.0.0) (2022-01-23)

### Bug Fixes

* Add support for invalid ipv6 URLs ([b32d16c](b32d16c)), closes [#114](#114)
* Remove auto-trimming of input ([4ea86a1](4ea86a1))

### BREAKING CHANGES

* parseDomain won't .trim() the given input. The input is interpreted as it is. If you want to trim the input, you need to call .trim() before passing it to parseDomain. Auto-trimming the input changes the domain and might not be desired if any character (such as whitespace) is allowed (e.g. when using lax validation).
@github-actions
Copy link

🎉 This issue has been resolved in version 7.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jhnns
Copy link
Member

jhnns commented Jan 23, 2022

IPv6 addresses need to be surrounded by [] in URLs, e.g. http://[1:2:3:4:5:6:7:8]/path?query
See https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2

I added experimental support for these invalid URLs in v7.0.0 but might remove it again if there are any other problems.

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

No branches or pull requests

2 participants