From 2806ae565e7c7e80981ddecb1bb4953d790fff7b Mon Sep 17 00:00:00 2001 From: flywind Date: Sun, 13 Sep 2020 09:28:09 +0800 Subject: [PATCH] bump --- changelog.md | 1 + examples/session/app.nim | 2 +- prologue.nimble | 2 +- src/prologue/auth/users.nim | 4 ++-- src/prologue/core/constants.nim | 2 +- src/prologue/core/types.nim | 6 +++--- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/changelog.md b/changelog.md index 2bbc42fca..d31e600f1 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,7 @@ Fixes that sessionMiddleware doesn't work when user do not register session. Fixes HttpHeaders and adds nil check. +Fixes cookies containing commas fail for asynchttpserver using base64 encode. ## 0.3.4 diff --git a/examples/session/app.nim b/examples/session/app.nim index f14670872..7d078ac87 100644 --- a/examples/session/app.nim +++ b/examples/session/app.nim @@ -13,6 +13,6 @@ let ) -var app = newApp(settings = settings, middlewares = @[sessionMiddleware(secretKey = secretKey.SecretKey)]) +var app = newApp(settings = settings, middlewares = @[debugRequestMiddleware(), sessionMiddleware(secretKey = secretKey.SecretKey)]) app.addRoute(urls.urlPatterns, "") app.run() diff --git a/prologue.nimble b/prologue.nimble index fe0a622fe..a7c25bbdd 100644 --- a/prologue.nimble +++ b/prologue.nimble @@ -1,6 +1,6 @@ # Package -version = "0.3.4" +version = "0.3.6" author = "flywind" description = "Full-Stack Web Framework." license = "Apache-2.0" diff --git a/src/prologue/auth/users.nim b/src/prologue/auth/users.nim index d5059b88e..e02c3bf47 100644 --- a/src/prologue/auth/users.nim +++ b/src/prologue/auth/users.nim @@ -2,13 +2,13 @@ from ../core/types import SecretKey type - User* = ref object of RootObj + User* = object of RootObj username: string password: SecretKey email: string firstName, lastName: string - SuperUser* = ref object of User + SuperUser* = object of User proc initUser*(username: string, password: SecretKey, email, firstName, lastName = ""): User = diff --git a/src/prologue/core/constants.nim b/src/prologue/core/constants.nim index 73baa4043..ca6003008 100644 --- a/src/prologue/core/constants.nim +++ b/src/prologue/core/constants.nim @@ -1,3 +1,3 @@ const - PrologueVersion* = "0.3.4" ## The version of Prologue. + PrologueVersion* = "0.3.6" ## The version of Prologue. ProloguePrefix* = "PROLOGUE_" ## The helper prefix for Prologue. diff --git a/src/prologue/core/types.nim b/src/prologue/core/types.nim index f66baaae8..36307d16c 100644 --- a/src/prologue/core/types.nim +++ b/src/prologue/core/types.nim @@ -13,7 +13,7 @@ # limitations under the License. -import strutils, strtabs, parseutils, tables +import strutils, strtabs, parseutils, tables, base64 type @@ -151,8 +151,8 @@ proc parseStringTable*(s: string): StringTableRef {.inline.} = proc loads*(session: Session, s: string) {.inline.} = ## Loads session from strings. - session.data.parseStringTable(s) + session.data.parseStringTable(decode(s)) proc dumps*(session: Session): string {.inline.} = ## Dumps session to strings. - $session + encode($session)