diff options
author | Ilya Mashchenko <ilya@netdata.cloud> | 2024-06-16 18:36:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-16 18:36:37 +0300 |
commit | 264c607f7a37d6022dd4d4ef5ab1b2903ac68f1b (patch) | |
tree | a3670ce16e9ffdbd30e38bc7e50a9cc301592a58 /src | |
parent | 28a96a3e5dc2b8a18fe2b9e40f83c6bce4bba5dd (diff) |
go.d whoisquery: check if exp date is empty (#17911)
Diffstat (limited to 'src')
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/whoisquery/provider.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/go/collectors/go.d.plugin/modules/whoisquery/provider.go b/src/go/collectors/go.d.plugin/modules/whoisquery/provider.go index 032f979f4c..23de81e280 100644 --- a/src/go/collectors/go.d.plugin/modules/whoisquery/provider.go +++ b/src/go/collectors/go.d.plugin/modules/whoisquery/provider.go @@ -3,6 +3,7 @@ package whoisquery import ( + "errors" "strings" "time" @@ -49,6 +50,10 @@ func (f *fromNet) remainingTime() (float64, error) { } } + if result.Domain.ExpirationDate == "" { + return 0, errors.New("no expiration date") + } + expire, err := dateparse.ParseAny(result.Domain.ExpirationDate) if err != nil { return 0, err |