fix #316
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
package context
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/astaxie/beego/middleware"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type Context struct {
|
||||
@@ -22,12 +21,12 @@ func (ctx *Context) Abort(status int, body string) {
|
||||
ctx.Output.SetStatus(status)
|
||||
ctx.Output.Body([]byte(body))
|
||||
|
||||
if e, ok := middleware.HTTPExceptionMaps[status]; ok {
|
||||
if len(body) >= 1 {
|
||||
e.Description = body
|
||||
}
|
||||
panic(e)
|
||||
}
|
||||
if e, ok := middleware.HTTPExceptionMaps[status]; ok {
|
||||
if len(body) >= 1 {
|
||||
e.Description = body
|
||||
}
|
||||
panic(e)
|
||||
}
|
||||
}
|
||||
|
||||
func (ctx *Context) WriteString(content string) {
|
||||
|
||||
Reference in New Issue
Block a user