stripe / smokescreen

A simple HTTP proxy that fogs over naughty URLs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Golang 1.17 adds a new IP.IsPrivate function we could use

mattm-stripe opened this issue · comments

https://pkg.go.dev/net#IP.IsPrivate

This function could be used instead of our own PrivateRuleRanges,

} else if addrIsInRuleRange(PrivateRuleRanges, addr) && !config.UnsafeAllowPrivateRanges {

https://github.com/stripe/smokescreen/blob/master/pkg/smokescreen/constants.go#L20-L25
https://github.com/stripe/smokescreen/blob/master/pkg/smokescreen/constants.go#L38-L45

As Smokescreen supports the two most recent Go releases, we should wait until 1.18 is released so that we can support both 1.17 and 1.18