mirror of
https://github.com/kataras/iris.git
synced 2025-12-17 09:57:01 +00:00
add a new simple, builtin requestid middleware (makes use of the Context.SetID/GetID methods too)
Former-commit-id: d46bce7c1964adada01934aa95daf389c141defc
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/kataras/iris/v12/context"
|
||||
|
||||
uuid "github.com/iris-contrib/go.uuid"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -71,7 +71,7 @@ func (c Config) Validate() Config {
|
||||
|
||||
if c.SessionIDGenerator == nil {
|
||||
c.SessionIDGenerator = func(context.Context) string {
|
||||
id, _ := uuid.NewV4()
|
||||
id, _ := uuid.NewRandom()
|
||||
return id.String()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ func init() {
|
||||
// on a Context, which returns a *Session, type.
|
||||
// It performs automatic memory cleanup on expired sessions.
|
||||
// It can accept a `Database` for persistence across server restarts.
|
||||
// A session can set temporarly values (flash messages).
|
||||
// A session can set temporary values (flash messages).
|
||||
type Sessions struct {
|
||||
config Config
|
||||
provider *provider
|
||||
|
||||
Reference in New Issue
Block a user