From 32575babdb62a5a480a2d3eefa082576567e6c51 Mon Sep 17 00:00:00 2001 From: Seraphim Strub Date: Sun, 4 Aug 2024 17:37:53 +0000 Subject: [PATCH] fix: test all endpoints and responses --- pkg/abuseipdb/client.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/abuseipdb/client.go b/pkg/abuseipdb/client.go index 308e18b..14870a1 100644 --- a/pkg/abuseipdb/client.go +++ b/pkg/abuseipdb/client.go @@ -294,8 +294,8 @@ func (c *Client) Reports(ctx context.Context, ip net.IP, opts *ReportsOptions) ( type BlacklistOptions struct { ConfidenceMinimum int `json:"confidenceMinimum,omitempty"` Limit int `json:"limit,omitempty"` - OnlyCountries []string `json:"onlyCountries,omitempty"` - ExceptCountries []string `json:"exceptCountries,omitempty"` + OnlyCountries []string `json:"onlyCountries,omitempty"` // does not work? + ExceptCountries []string `json:"exceptCountries,omitempty"` // seems to work IpVersion int `json:"ipVersion,omitempty"` } @@ -445,14 +445,14 @@ type CheckBlockResult struct { } `json:"data"` } -func (c *Client) CheckBlock(ctx context.Context, ipnNet net.IPNet, opts *CheckBlockOptions) (*CheckBlockResult, error) { +func (c *Client) CheckBlock(ctx context.Context, ipnNet *net.IPNet, opts *CheckBlockOptions) (*CheckBlockResult, error) { var endpoint = "check-block" network := html.EscapeString(ipnNet.String()) parameters := map[string]string{ "network": network, } - // TODO check network + if opts != nil { if opts.MaxAgeInDays > 0 && opts.MaxAgeInDays <= 365 { parameters["maxAgeInDays"] = strconv.Itoa(opts.MaxAgeInDays)