go-siris / siris

DEPRECATED: The community driven fork of Iris. The fastest web framework for Golang!
Other
142 stars 16 forks source link

Full server hang after setting Flash Message and redirecting #66

Closed Allendar closed 7 years ago

Allendar commented 7 years ago

Go 1.8.3. Homebrew macOS Sierra 10.12.6

The following code reproduces the error. You go to /. Then it redirects to /landing. Then if you go to the / url again (or any that you would define), the request hangs forever.

package main

import (
    "github.com/go-siris/siris"
    "github.com/go-siris/siris/context"
    "github.com/go-siris/siris/middleware/logger"
    "github.com/go-siris/siris/sessions"
)

func main() {
    app := siris.New()

    app.Use(logger.New())
    app.AttachSessionManager(sessions.New(sessions.Config{
        Cookie: "sid",
    }))

    app.Get("/", func(c context.Context) {
        c.Session().SetFlash("test", "testString")
        c.Redirect("/landing")
    })

    app.Get("/landing", func(c context.Context) {
        c.WriteString(c.Session().GetFlashString("test"))
    })

    app.Run(siris.Addr(":8085"))
}
Dexus commented 7 years ago

Do you use the master branch?

Allendar commented 7 years ago

No the 7.3.4 release. I'll try it on the master branch in a bit.

Dexus commented 7 years ago

ok, I will also look into it.

Allendar commented 7 years ago

Looked into together with @Dexus. Will be outphased in the next version, to use the normal Session functionality instead of the Flash helper-functions. Still a bug in the current release, but won't be anymore as it'll be deprecated in 7.4.0.