mirror of
https://github.com/georgyo/ifconfig.io.git
synced 2025-09-15 00:22:28 +00:00
Add support for chained X-Forwarded-For headers
This commit is contained in:
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
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user