You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[INFO] 2020/09/10 07:18 200 239.519µs [REDACTED] POST /contact
# ------------------ ^^^# should have been a 500 if the POST handler was executed
Code
func (c*PublicController) BeforeActivation(b mvc.BeforeActivation) {
b.Router().Use(cache.Handler(time.Minute))
}
func (c*PublicController) GetContact(ctx iris.Context) mvc.Result {
golog.Warn("Sanity Check: This is the GET Handler")
return mvc.View{
Code: iris.StatusOK,
Name: "contact.html",
}
}
func (c*PublicController) PostContact(ctx iris.Context) mvc.Result {
golog.Warn("Sanity Check: This is the POST Handler")
return mvc.View{
Code: iris.StatusInternalServerError,
Text: "It's a bug if you DON'T see this.",
}
}
The text was updated successfully, but these errors were encountered:
Oh thanks @AlbinoGeek, this is fixed now. Also, now you have the ability to set the cache entry key/identifier with cache.WithKey(string) iris.Handler (use as middleware) or cache/client.SetKey(iris.Context, string). Example has been updated too.
Summary
cache.Handler(time.Minute)
meant aPOST
ed Contact Form returned the empty/unfilledGET
handler from cache!The
POST
handler was not executed, if theGET
handler has been reached within the same cache time (Minute)Versions, etc.
Console Output
Code
The text was updated successfully, but these errors were encountered: