Fix dependency injection and implement proper CIDR checking
- Add http module for proper FX dependency injection - Fix router to accept state manager parameter - Implement proper CIDR-based checking for RFC1918 and documentation IPs - Add reasonable timeouts (30s) for database downloads - Update tests to download databases to temporary directories - Add tests for multiple IP lookups and error cases - All tests passing
This commit is contained in:
@@ -25,7 +25,7 @@ const (
|
||||
cityFile = "GeoLite2-City.mmdb"
|
||||
countryFile = "GeoLite2-Country.mmdb"
|
||||
|
||||
downloadTimeout = 5 * time.Minute
|
||||
downloadTimeout = 30 * time.Second
|
||||
updateInterval = 7 * 24 * time.Hour // 1 week
|
||||
|
||||
defaultDirPermissions = 0750
|
||||
|
||||
Reference in New Issue
Block a user