diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-01-08 20:15:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-08 14:15:06 +0200 |
commit | ce43d38b4ffa40255cc8f859c5b31f59351f827c (patch) | |
tree | d309312f735491278abe31493e70370259d11002 /vendor/gitea.com | |
parent | 461406070c1fa8015d6dba17ae32bb43f78db3fc (diff) | |
download | gitea-ce43d38b4ffa40255cc8f859c5b31f59351f827c.tar.gz gitea-ce43d38b4ffa40255cc8f859c5b31f59351f827c.zip |
Fix session bug when introduce chi (#14287)
* Update go-chi session
Diffstat (limited to 'vendor/gitea.com')
-rw-r--r-- | vendor/gitea.com/go-chi/session/session.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/vendor/gitea.com/go-chi/session/session.go b/vendor/gitea.com/go-chi/session/session.go index 97eb5ad365..475612ffb1 100644 --- a/vendor/gitea.com/go-chi/session/session.go +++ b/vendor/gitea.com/go-chi/session/session.go @@ -101,7 +101,8 @@ type Options struct { FlashEncryptionKey string } -func prepareOptions(options []Options) Options { +// PrepareOptions gives some default values for options +func PrepareOptions(options []Options) Options { var opt Options if len(options) > 0 { opt = options[0] @@ -231,7 +232,7 @@ func NewCookie(name string, value string, others ...interface{}) *http.Cookie { // Sessioner is a middleware that maps a session.SessionStore service into the Macaron handler chain. // An single variadic session.Options struct can be optionally provided to configure. func Sessioner(options ...Options) func(next http.Handler) http.Handler { - opt := prepareOptions(options) + opt := PrepareOptions(options) manager, err := NewManager(opt.Provider, opt) if err != nil { panic(err) |