summaryrefslogtreecommitdiff
path: root/service/http/config.go
diff options
context:
space:
mode:
authorSmolyakov <[email protected]>2019-09-01 15:36:42 +0300
committerSmolyakov <[email protected]>2019-09-01 15:36:42 +0300
commit488a9774636ece92e730a41092403410910d566f (patch)
treeed1138e5f2af51089650f16fde471738ca06565e /service/http/config.go
parent49e002c11e5cc915d80efa58611f4c4a72de7bb2 (diff)
Use last IP address from X-Forwarded-For without validation of trusty
Diffstat (limited to 'service/http/config.go')
-rw-r--r--service/http/config.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/service/http/config.go b/service/http/config.go
index ff15e83e..25be205c 100644
--- a/service/http/config.go
+++ b/service/http/config.go
@@ -189,6 +189,14 @@ func (c *Config) IsTrusted(ip string) bool {
return false
}
+func (c *Config) IsValid(ip string) bool {
+ i := net.ParseIP(ip)
+ if i == nil {
+ return false
+ }
+ return true
+}
+
// Valid validates the configuration.
func (c *Config) Valid() error {
if c.Uploads == nil {