1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-13 05:41:02 +00:00

update abort & error show & sessionRelease in defer

This commit is contained in:
astaxie
2013-12-16 22:54:29 +08:00
parent 7fd18ba639
commit f8708d01bf
4 changed files with 31 additions and 200 deletions

View File

@ -70,12 +70,6 @@ func (c *Controller) Finish() {
}
func (c *Controller) Destructor() {
if c.CruSession != nil {
c.CruSession.SessionRelease()
}
}
func (c *Controller) Get() {
http.Error(c.Ctx.ResponseWriter, "Method Not Allowed", 405)
}
@ -178,7 +172,16 @@ func (c *Controller) Redirect(url string, code int) {
}
func (c *Controller) Abort(code string) {
panic(code)
status, err := strconv.Atoi(code)
if err == nil {
c.Ctx.Abort(status, code)
} else {
c.Ctx.Abort(200, code)
}
}
func (c *Controller) StopRun() {
panic("")
}
func (c *Controller) UrlFor(endpoint string, values ...string) string {