diff --git a/middleware/encryptcookie/README.md b/middleware/encryptcookie/README.md index 4a527c5a1b..2f9a8463ee 100644 --- a/middleware/encryptcookie/README.md +++ b/middleware/encryptcookie/README.md @@ -64,7 +64,7 @@ type Config struct { // Array of cookie keys that should not be encrypted. // - // Optional. Default: [] + // Optional. Default: ["csrf_"] Except []string // Base64 encoded unique key to encode & decode cookies. @@ -94,4 +94,4 @@ type Config struct { app.Use(encryptcookie.New(encryptcookie.Config{ Key: "secret-thirty-2-character-string", })) -``` \ No newline at end of file +``` diff --git a/middleware/encryptcookie/config.go b/middleware/encryptcookie/config.go index 979b04ef34..735c2f2d28 100644 --- a/middleware/encryptcookie/config.go +++ b/middleware/encryptcookie/config.go @@ -34,7 +34,7 @@ type Config struct { // ConfigDefault is the default config var ConfigDefault = Config{ Next: nil, - Except: make([]string, 0), + Except: []string{"csrf_"}, Key: "", Encryptor: EncryptCookie, Decryptor: DecryptCookie,