fix: test all endpoints and responses
This commit is contained in:
parent
8c8b86bfa0
commit
32575babdb
1 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue