Skip to content

Commit

Permalink
fix(#188): limit requestid length to 8
Browse files Browse the repository at this point in the history
  • Loading branch information
Jumpy-Squirrel committed Dec 22, 2023
1 parent 63000ee commit 3921f0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/web/middleware/requestid_in_ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func AddRequestIdToContextAndResponse(next http.Handler) http.Handler {
ctx := r.Context()

reqIdStr := r.Header.Get(TraceIdHeader)
if reqIdStr == "" {
if reqIdStr == "" || len(reqIdStr) > 8 {
reqUuid, err := uuid.NewRandom()
if err == nil {
reqIdStr = reqUuid.String()[:8]
Expand Down

0 comments on commit 3921f0b

Please sign in to comment.