Skip to content

Commit

Permalink
middleware/requestid: mention that the default UUID generator exposes…
Browse files Browse the repository at this point in the history
… the number of requests made to the server (#2241)
  • Loading branch information
leonklingele committed Dec 1, 2022
1 parent 6d798db commit 17dfcc7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 6 additions & 4 deletions middleware/requestid/README.md
Expand Up @@ -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",
}
```
3 changes: 3 additions & 0 deletions middleware/requestid/config.go
Expand Up @@ -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,
Expand Down

1 comment on commit 17dfcc7

@ReneWerner87
Copy link
Member

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 17dfcc7 Previous: 6d798db Ratio
Benchmark_AcquireCtx 1265 ns/op 1568 B/op 5 allocs/op 629.8 ns/op 1568 B/op 5 allocs/op 2.01

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.