mirror of https://github.com/gofiber/fiber.git
♻️ Refactor: Use Global vars instead of local vars for isLocalHost (#2595)
♻️ Refactor: Use Global vars instead of local vars for isLocalHost
pull/2597/head
parent
408501434a
commit
8ec7cec435
3
ctx.go
3
ctx.go
|
@ -1887,9 +1887,10 @@ func (c *Ctx) IsProxyTrusted() bool {
|
|||
return false
|
||||
}
|
||||
|
||||
var localHosts = [...]string{"127.0.0.1", "0.0.0.0", "::1"}
|
||||
|
||||
// IsLocalHost will return true if address is a localhost address.
|
||||
func (*Ctx) isLocalHost(address string) bool {
|
||||
localHosts := []string{"127.0.0.1", "0.0.0.0", "::1"}
|
||||
for _, h := range localHosts {
|
||||
if strings.Contains(address, h) {
|
||||
return true
|
||||
|
|
Loading…
Reference in New Issue