Add support for chained X-Forwarded-For headers

This commit is contained in:
George Shammas 2021-04-10 09:36:08 -04:00
parent 20c1bb595a
commit ef8a65594a
1 changed files with 1 additions and 1 deletions

View File

@ -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
} }