Skip to content

Commit

Permalink
🩹 Fix: Move TrustProxyConfig.Loopback to beginning of if-statement
Browse files Browse the repository at this point in the history
  • Loading branch information
xEricL committed Oct 15, 2024
1 parent 7cb9bb2 commit 1732cb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -1828,8 +1828,8 @@ func (c *DefaultCtx) IsProxyTrusted() bool {

ip := c.fasthttp.RemoteIP()

if (c.app.config.TrustProxyConfig.Private && ip.IsPrivate()) ||
(c.app.config.TrustProxyConfig.Loopback && ip.IsLoopback()) ||
if (c.app.config.TrustProxyConfig.Loopback && ip.IsLoopback()) ||
(c.app.config.TrustProxyConfig.Private && ip.IsPrivate()) ||
(c.app.config.TrustProxyConfig.LinkLocal && ip.IsLinkLocalUnicast()) {
return true
}
Expand Down

0 comments on commit 1732cb5

Please sign in to comment.