Add support for chained X-Forwarded-For headers
This commit is contained in:
parent
20c1bb595a
commit
ef8a65594a
2
main.go
2
main.go
|
@ -80,7 +80,7 @@ func mainHandler(c *gin.Context) {
|
||||||
c.Abort()
|
c.Abort()
|
||||||
}
|
}
|
||||||
|
|
||||||
header_ip := net.ParseIP(c.Request.Header.Get(configuration.ipheader))
|
header_ip := net.ParseIP(strings.Split(c.Request.Header.Get(configuration.ipheader), ",")[0])
|
||||||
if header_ip != nil {
|
if header_ip != nil {
|
||||||
ip.IP = header_ip
|
ip.IP = header_ip
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue