summaryrefslogtreecommitdiff
path: root/plugins/http/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/http/config.go')
-rw-r--r--plugins/http/config.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/http/config.go b/plugins/http/config.go
index 00d2940b..3b670c86 100644
--- a/plugins/http/config.go
+++ b/plugins/http/config.go
@@ -11,8 +11,10 @@ import (
poolImpl "github.com/spiral/roadrunner/v2/pkg/pool"
)
+// Cidrs is a slice of IPNet addresses
type Cidrs []*net.IPNet
+// IsTrusted checks if the ip address exists in the provided in the config addresses
func (c *Cidrs) IsTrusted(ip string) bool {
if len(*c) == 0 {
return false
@@ -137,7 +139,7 @@ func (c *Config) EnableFCGI() bool {
return c.FCGI.Address != ""
}
-// Hydrate must populate Config values using given Config source. Must return error if Config is not valid.
+// InitDefaults must populate Config values using given Config source. Must return error if Config is not valid.
func (c *Config) InitDefaults() error {
if c.Pool == nil {
// default pool
@@ -202,6 +204,7 @@ func (c *Config) InitDefaults() error {
return c.Valid()
}
+// ParseCIDRs parse IPNet addresses and return slice of its
func ParseCIDRs(subnets []string) (Cidrs, error) {
c := make(Cidrs, 0, len(subnets))
for _, cidr := range subnets {