Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions LICENSE
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (C) 2020 THREATINT (CYPRUS) LTD)
Copyright (C) 2020-2025 FSTPN Cyprus Limited (formally: "THREATINT (CYPRUS) LTD)")

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
10 changes: 5 additions & 5 deletions README.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ We have received feedback from software developers who were confused about how t
specific cases. Examples include but are not limited to:
* URLs:
* We consider URLs that do not have a scheme as valid.
This is a clear violation of [RFC#3986](https://www.rfc-editor.org/rfc/rfc3986.txt)
This is a clear violation of [RFC #3986](https://www.rfc-editor.org/rfc/rfc3986.txt)
that says *The scheme and path components are required, (...)*.
We are doing this because of several of our own use cases where we had to process large lists of URLs that did
not contain a scheme in each end every case. We neither wanted to add a scheme like `http://` by default nor simply
reject entries. If you, however, need a URL that fully complies to RFC#3986
(e.g. because you want to use it with other libraries), please call ```NormaliseURLSchema()```.
reject entries. If you, however, need a URL that fully complies to RFC #3986
(e.g. because you want to use it with other libraries), please call `NormaliseURLSchema()`.
* Domains
* To get an idea, what a valid domain name looks like, we use the list of TLDs (top-level-domains) from
[IANA](https://data.iana.org/TLD/tlds-alpha-by-domain.txt).
[PublicSuffixes.org]("https://publicsuffix.org/list/public_suffix_list.dat").
* FQDNs
* _www.site.tld_ **is not** a URL but a FQDN (fully qualified domain name), because it neither has a path component
nor a schema (`http://`, `https://`, etc.).
Expand All @@ -40,4 +40,4 @@ If something still does not make sense, let us know by starting a discussion or
Release under the MIT License. (see LICENSE)

## QA
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/01c46c2a6f10458f8e7f09fff5ae1915)](https://app.codacy.com/gh/THREATINT/go-net/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/01c46c2a6f10458f8e7f09fff5ae1915)](https://app.codacy.com/gh/THREATINT/go-net/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
Empty file modified domain.go
100755 → 100644
Empty file.
Empty file modified domain_test.go
100755 → 100644
Empty file.
Empty file modified fqdn.go
100755 → 100644
Empty file.
Empty file modified fqdn_test.go
100755 → 100644
Empty file.
6 changes: 3 additions & 3 deletions go.mod
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/THREATINT/go-net

go 1.24.0
go 1.24

require (
github.com/PuerkitoBio/purell v1.2.1
golang.org/x/net v0.39.0
golang.org/x/net v0.42.0
)

require golang.org/x/text v0.24.0 // indirect
require golang.org/x/text v0.27.0 // indirect
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY=
golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E=
golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs=
golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8=
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0=
golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4=
golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU=
Empty file modified ip.go
100755 → 100644
Empty file.
Empty file modified ip_test.go
100755 → 100644
Empty file.
47 changes: 44 additions & 3 deletions publicSuffixList_gen.go
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ var PublicSuffix = []string {
"mutual.ar",
"net.ar",
"org.ar",
"seg.ar",
"senasa.ar",
"tur.ar",
"as",
Expand Down Expand Up @@ -760,18 +761,57 @@ var PublicSuffix = []string {
"soc.dz",
"tm.dz",
"ec",
"abg.ec",
"adm.ec",
"agron.ec",
"arqt.ec",
"art.ec",
"bar.ec",
"chef.ec",
"com.ec",
"cont.ec",
"cpa.ec",
"cue.ec",
"dent.ec",
"dgn.ec",
"disco.ec",
"doc.ec",
"edu.ec",
"eng.ec",
"esm.ec",
"fin.ec",
"fot.ec",
"gal.ec",
"gob.ec",
"gov.ec",
"gye.ec",
"ibr.ec",
"info.ec",
"k12.ec",
"lat.ec",
"loj.ec",
"med.ec",
"mil.ec",
"mktg.ec",
"mon.ec",
"net.ec",
"ntr.ec",
"odont.ec",
"org.ec",
"pro.ec",
"prof.ec",
"psic.ec",
"psiq.ec",
"pub.ec",
"rio.ec",
"rrpp.ec",
"sal.ec",
"tech.ec",
"tul.ec",
"tur.ec",
"uio.ec",
"vet.ec",
"xxx.ec",
"edu",
"ee",
"aip.ee",
Expand Down Expand Up @@ -866,10 +906,12 @@ var PublicSuffix = []string {
"net.gg",
"org.gg",
"gh",
"biz.gh",
"com.gh",
"edu.gh",
"gov.gh",
"mil.gh",
"net.gh",
"org.gh",
"gi",
"com.gi",
Expand Down Expand Up @@ -1024,6 +1066,7 @@ var PublicSuffix = []string {
"co.id",
"desa.id",
"go.id",
"kop.id",
"mil.id",
"my.id",
"net.id",
Expand Down Expand Up @@ -5845,7 +5888,6 @@ var PublicSuffix = []string {
"beats",
"beauty",
"beer",
"bentley",
"berlin",
"best",
"bestbuy",
Expand Down Expand Up @@ -6195,6 +6237,7 @@ var PublicSuffix = []string {
"host",
"hosting",
"hot",
"hotel",
"hotels",
"hotmail",
"house",
Expand Down Expand Up @@ -6272,7 +6315,6 @@ var PublicSuffix = []string {
"lacaixa",
"lamborghini",
"lamer",
"lancaster",
"land",
"landrover",
"lanxess",
Expand Down Expand Up @@ -6467,7 +6509,6 @@ var PublicSuffix = []string {
"poker",
"politie",
"porn",
"pramerica",
"praxi",
"press",
"prime",
Expand Down
Empty file modified url.go
100755 → 100644
Empty file.
Empty file modified url_test.go
100755 → 100644
Empty file.