Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ip-address.md #296

Merged
merged 2 commits into from
Aug 22, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions website/docs/guide/ip-address.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ E.g.:

```go
e.IPExtractor = echo.ExtractIPFromXFFHeader(
TrustLinkLocal(false),
TrustIPRanges(lbIPRange),
echo.TrustLoopback(false), // e.g. ipv4 start with 127.
echo.TrustLinkLocal(false), // e.g. ipv4 start with 169.254
echo.TrustPrivateNet(false), // e.g. ipv4 start with 10. or 192.168
echo.TrustIPRange(echo.lbIPRange),
Copy link
Contributor

@aldas aldas Aug 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

echo.lbIPRange should probably be lbIPRange. Other than that - this PR seems ok

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.
thank you

)
```

Expand Down Expand Up @@ -106,4 +108,4 @@ Again, it trusts internal IP addresses by default (loopback, link-local unicast,
In default behavior, Echo sees all of first XFF header, X-Real-IP header and IP from network layer.

As you might already notice, after reading this article, this is not good.
Sole reason this is default is just backward compatibility.
Sole reason this is default is just backward compatibility.