From acfaef55f7e8f5af9f307afab2bbbf1a19f1c4fa Mon Sep 17 00:00:00 2001 From: amir Date: Sun, 9 Jan 2022 21:17:53 +0330 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Fix:=20Add=20`csrf=5F`=20to=20de?= =?UTF-8?q?fault=20encrypt=20cookie=20exception=20(#1631)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- middleware/encryptcookie/README.md | 4 ++-- middleware/encryptcookie/config.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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,