Skip to content

Commit 5892998

Browse files
committed
Fix a leak
1 parent 525b19f commit 5892998

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

session/session.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package session
22

33
import (
4+
"github.com/gorilla/context"
45
"github.com/gorilla/sessions"
56
"github.com/labstack/echo"
67
"github.com/labstack/echo/middleware"
@@ -58,6 +59,7 @@ func MiddlewareWithConfig(config Config) echo.MiddlewareFunc {
5859
if config.Skipper(c) {
5960
return next(c)
6061
}
62+
defer context.Clear(c.Request())
6163
c.Set(key, config.Store)
6264
return next(c)
6365
}

0 commit comments

Comments
 (0)