diff options
Diffstat (limited to 'internal/safehttp')
| -rw-r--r-- | internal/safehttp/safehttp.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/safehttp/safehttp.go b/internal/safehttp/safehttp.go index cfc70f1..e0859c4 100644 --- a/internal/safehttp/safehttp.go +++ b/internal/safehttp/safehttp.go @@ -8,7 +8,10 @@ import ( "time" ) -var privateIPBlocks []*net.IPNet +var ( + privateIPBlocks []*net.IPNet + AllowLocal bool // For testing +) func init() { for _, cidr := range []string{ @@ -27,6 +30,9 @@ func init() { } func isPrivateIP(ip net.IP) bool { + if AllowLocal { + return false + } if ip.IsLoopback() || ip.IsLinkLocalUnicast() || ip.IsLinkLocalMulticast() { return true } |
