Skip to content

Commit

Permalink
CookieSameSite default "Lax"
Browse files Browse the repository at this point in the history
  • Loading branch information
sixcolors committed Dec 1, 2021
1 parent 57607f1 commit 4141877
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions middleware/csrf/README.md
Expand Up @@ -46,7 +46,7 @@ app.Use(csrf.New()) // Default config
app.Use(csrf.New(csrf.Config{
KeyLookup: "header:X-Csrf-Token",
CookieName: "csrf_",
CookieSameSite: "Strict",
CookieSameSite: "Lax",
Expiration: 1 * time.Hour,
KeyGenerator: utils.UUID,
}))
Expand Down Expand Up @@ -106,7 +106,7 @@ type Config struct {
CookieHTTPOnly bool

// Indicates if CSRF cookie is requested by SameSite.
// Optional. Default value "Strict".
// Optional. Default value "Lax".
CookieSameSite string

// Expiration is the duration before csrf token will expire
Expand Down Expand Up @@ -138,7 +138,7 @@ type Config struct {
var ConfigDefault = Config{
KeyLookup: "header:X-Csrf-Token",
CookieName: "csrf_",
CookieSameSite: "Strict",
CookieSameSite: "Lax",
Expiration: 1 * time.Hour,
KeyGenerator: utils.UUID,
}
Expand Down
4 changes: 2 additions & 2 deletions middleware/csrf/config.go
Expand Up @@ -50,7 +50,7 @@ type Config struct {
CookieHTTPOnly bool

// Value of SameSite cookie.
// Optional. Default value "Strict".
// Optional. Default value "Lax".
CookieSameSite string

// Expiration is the duration before csrf token will expire
Expand Down Expand Up @@ -96,7 +96,7 @@ type Config struct {
var ConfigDefault = Config{
KeyLookup: "header:X-Csrf-Token",
CookieName: "csrf_",
CookieSameSite: "Strict",
CookieSameSite: "Lax",
Expiration: 1 * time.Hour,
KeyGenerator: utils.UUID,
ErrorHandler: defaultErrorHandler,
Expand Down

0 comments on commit 4141877

Please sign in to comment.