use the ortam config library in the API
Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
@ -10,10 +10,9 @@ import (
|
||||
|
||||
func IP(c *fiber.Ctx) string {
|
||||
conf := c.Locals("config").(*config.Type)
|
||||
ip_header := conf.GetStr("ip_header")
|
||||
|
||||
if ip_header != "" && c.Get(ip_header) != "" {
|
||||
return strings.Clone(c.Get(ip_header))
|
||||
if conf.IPHeader != "" && c.Get(conf.IPHeader) != "" {
|
||||
return strings.Clone(c.Get(conf.IPHeader))
|
||||
}
|
||||
|
||||
return c.IP()
|
||||
|
Reference in New Issue
Block a user