diff options
Diffstat (limited to 'internal/middleware')
| -rw-r--r-- | internal/middleware/requestid.go | 14 | 
1 files changed, 6 insertions, 8 deletions
| diff --git a/internal/middleware/requestid.go b/internal/middleware/requestid.go index 3bf38092f..00b1ff299 100644 --- a/internal/middleware/requestid.go +++ b/internal/middleware/requestid.go @@ -39,8 +39,8 @@ var (  	base32enc = base32.NewEncoding("0123456789abcdefghjkmnpqrstvwxyz").WithPadding(-1)  ) -// generateID generates a new ID string. -func generateID() string { +// NewRequestID generates a new request ID string. +func NewRequestID() string {  	// 0:8  = timestamp  	// 8:12 = entropy  	// @@ -69,12 +69,10 @@ func AddRequestID(header string) gin.HandlerFunc {  		// Have we found anything?  		if id == "" {  			// Generate new ID. -			// -			// 0:8  = timestamp -			// 8:12 = entropy -			id = generateID() -			// Set the request ID in the req header in case we pass the request along -			// to another service +			id = NewRequestID() + +			// Set the request ID in the req header in case +			// we pass the request along to another service.  			c.Request.Header.Set(header, id)  		} | 
