Skip to content

Commit 9cacad4

Browse files
Add docs from gofiber/fiber@298975a
1 parent 9634a8d commit 9cacad4

File tree

5 files changed

+83
-49
lines changed

5 files changed

+83
-49
lines changed

docs/core/api/ctx.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ app.Get("/", func(c fiber.Ctx) error {
831831
## IsProxyTrusted
832832
833833
Checks trustworthiness of remote ip.
834-
If [`EnableTrustedProxyCheck`](fiber.md#enabletrustedproxycheck) false, it returns true
834+
If [`TrustProxy`](fiber.md#trustproxy) false, it returns true
835835
IsProxyTrusted can check remote ip by proxy ranges and ip map.
836836
837837
```go title="Signature"
@@ -841,10 +841,13 @@ func (c Ctx) IsProxyTrusted() bool
841841
```go title="Example"
842842

843843
app := fiber.New(fiber.Config{
844-
// EnableTrustedProxyCheck enables the trusted proxy check
845-
EnableTrustedProxyCheck: true,
846-
// TrustedProxies is a list of trusted proxy IP addresses
847-
TrustedProxies: []string{"0.8.0.0", "0.8.0.1"},
844+
// TrustProxy enables the trusted proxy check
845+
TrustProxy: true,
846+
// TrustProxyConfig allows for configuring trusted proxies.
847+
// Proxies is a list of trusted proxy IP ranges/addresses
848+
TrustProxyConfig: fiber.TrustProxyConfig{
849+
Proxies: []string{"0.8.0.0", "0.8.0.1"},
850+
}
848851
})
849852

850853

@@ -1640,7 +1643,7 @@ app.Post("/", func(c fiber.Ctx) error {
16401643
Contains the request protocol string: http or https for TLS requests.
16411644
16421645
:::info
1643-
Please use [`Config.EnableTrustedProxyCheck`](fiber.md#enabletrustedproxycheck) to prevent header spoofing, in case when your app is behind the proxy.
1646+
Please use [`Config.TrustProxy`](fiber.md#trustproxy) to prevent header spoofing, in case when your app is behind the proxy.
16441647
:::
16451648
16461649
```go title="Signature"

0 commit comments

Comments
 (0)