Skip to content

Commit ac51599

Browse files
Add docs from gofiber/fiber@323d2c8
1 parent a322cf0 commit ac51599

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

docs/core/whats_new.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,8 +1115,6 @@ We've added support for `zstd` compression on top of `gzip`, `deflate`, and `bro
11151115

11161116
The `Expiration` field in the CSRF middleware configuration has been renamed to `IdleTimeout` to better describe its functionality. Additionally, the default value has been reduced from 1 hour to 30 minutes.
11171117

1118-
The `ContextKey` field has been removed. Tokens and handlers are now stored using unexported keys; retrieve them with `csrf.TokenFromContext(c)` or `csrf.HandlerFromContext(c)`.
1119-
11201118
### EncryptCookie
11211119

11221120
Added support for specifying key length when using `encryptcookie.GenerateKey(length)`. Keys must be base64-encoded and may be 16, 24, or 32 bytes when decoded, supporting AES-128, AES-192, and AES-256 (default).
@@ -2000,7 +1998,7 @@ The `github.com/gofiber/utils/v2` module also introduces new helpers like `Parse
20001998
**Impact:** Directly accessing these middleware-provided values via `c.Locals("some_string_key")` will no longer work.
20011999

20022000
**Migration Action:**
2003-
You must update your code to use the dedicated exported functions provided by each affected middleware to retrieve its data from the context.
2001+
The `ContextKey` configuration option has been removed from all middlewares. Values are no longer stored under user-defined keys. You must update your code to use the dedicated exported functions provided by each affected middleware to retrieve its data from the context.
20042002

20052003
**Examples of new helper functions to use:**
20062004

@@ -2109,13 +2107,6 @@ app.Use(csrf.New(csrf.Config{
21092107
}))
21102108
```
21112109

2112-
- **ContextKey Removal**: The `ContextKey` field has been removed from the CSRF middleware configuration. Access the token and handler using helper functions instead:
2113-
2114-
```go
2115-
token := csrf.TokenFromContext(c)
2116-
handler := csrf.HandlerFromContext(c)
2117-
```
2118-
21192110
- **Session Key Removal**: The `SessionKey` field has been removed from the CSRF middleware configuration. The session key is now an unexported constant within the middleware to avoid potential key collisions in the session store.
21202111

21212112
- **KeyLookup Field Removal**: The `KeyLookup` field has been removed from the CSRF middleware configuration. This field was deprecated and is no longer needed as the middleware now uses a more secure approach for token management.

0 commit comments

Comments
 (0)