use the ortam config library in the API

Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
ngn
2025-04-13 01:06:37 +03:00
parent 322d8d5c39
commit 05185cb82a
10 changed files with 60 additions and 139 deletions

View File

@ -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()