feat(thoth): make ASNChecker instances

Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
Xe Iaso
2025-05-21 15:51:11 -04:00
parent 86ad85909c
commit 4aea22fac5
3 changed files with 22 additions and 3 deletions

View File

@@ -10,7 +10,7 @@ import (
type ASNChecker struct {
iptoasn iptoasnv1.IpToASNServiceClient
asns map[int]struct{}
asns map[uint32]struct{}
hash string
}
@@ -25,7 +25,7 @@ func (asnc *ASNChecker) Check(r *http.Request) (bool, error) {
return false, err
}
_, ok := asnc.asns[int(ipInfo.GetAsNumber())]
_, ok := asnc.asns[uint32(ipInfo.GetAsNumber())]
return ok, nil
}