middleware/requestid: mention that the default UUID generator exposes the number of requests made to the server (#2241)

pull/2256/head
leonklingele 2022-12-01 09:11:14 +01:00 committed by GitHub
parent 6d798dbda9
commit 17dfcc756b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -64,13 +64,15 @@ type Config struct {
```
### Default Config
The default config uses a fast UUID generator which will expose the number of
requests made to the server. To conceal this value for better privacy, use the
`utils.UUIDv4` generator.
```go
var ConfigDefault = Config{
Next: nil,
Header: fiber.HeaderXRequestID,
Generator: func() string {
return utils.UUID()
},
ContextKey: "requestid"
Generator: utils.UUID,
ContextKey: "requestid",
}
```

View File

@ -30,6 +30,9 @@ type Config struct {
}
// ConfigDefault is the default config
// It uses a fast UUID generator which will expose the number of
// requests made to the server. To conceal this value for better
// privacy, use the "utils.UUIDv4" generator.
var ConfigDefault = Config{
Next: nil,
Header: fiber.HeaderXRequestID,