mirror of
https://github.com/eiblog/eiblog.git
synced 2026-02-10 16:42:26 +08:00
使用github的七牛SDK,配置名称Kodo->Qiniu
This commit is contained in:
6
vendor/github.com/gorilla/sessions/README.md
generated
vendored
6
vendor/github.com/gorilla/sessions/README.md
generated
vendored
@@ -44,14 +44,14 @@ Let's start with an example that shows the sessions API in a nutshell:
|
||||
|
||||
First we initialize a session store calling `NewCookieStore()` and passing a
|
||||
secret key used to authenticate the session. Inside the handler, we call
|
||||
`store.Get()` to retrieve an existing session or a new one. Then we set some
|
||||
session values in session.Values, which is a `map[interface{}]interface{}`.
|
||||
`store.Get()` to retrieve an existing session or create a new one. Then we set
|
||||
some session values in session.Values, which is a `map[interface{}]interface{}`.
|
||||
And finally we call `session.Save()` to save the session in the response.
|
||||
|
||||
Important Note: If you aren't using gorilla/mux, you need to wrap your handlers
|
||||
with
|
||||
[`context.ClearHandler`](http://www.gorillatoolkit.org/pkg/context#ClearHandler)
|
||||
as or else you will leak memory! An easy way to do this is to wrap the top-level
|
||||
or else you will leak memory! An easy way to do this is to wrap the top-level
|
||||
mux when calling http.ListenAndServe:
|
||||
|
||||
```go
|
||||
|
||||
4
vendor/github.com/gorilla/sessions/store_test.go
generated
vendored
4
vendor/github.com/gorilla/sessions/store_test.go
generated
vendored
@@ -59,6 +59,10 @@ func TestGH2MaxLength(t *testing.T) {
|
||||
w := httptest.NewRecorder()
|
||||
|
||||
session, err := store.New(req, "my session")
|
||||
if err != nil {
|
||||
t.Fatal("failed to create session", err)
|
||||
}
|
||||
|
||||
session.Values["big"] = make([]byte, base64.StdEncoding.DecodedLen(4096*2))
|
||||
err = session.Save(req, w)
|
||||
if err == nil {
|
||||
|
||||
Reference in New Issue
Block a user