自定义处理异常的时候设置返回数据的content-type 但是没有生效 一直是Content-Type: text/plain; charset=utf-8, ``` // 异常处理 type M map[string]interface{} func ExceptionHandle(ctx dotweb.Context, err error) { ctx.Response().SetContentType(dotweb.MIMEApplicationJSONCharsetUTF8) ctx.WriteJsonC(http.StatusInternalServerError, M{"error": err.Error()}) } ``` ``` app := dotweb.New() // 处理错误响应 app.SetExceptionHandle(ExceptionHandle) ```
Activity
#### Version 1.4.9.2
Merge pull request #113 from devfeel/develop
devfeel commentedon Mar 28, 2018
fixed on version 1.4.9.2
westoi commentedon Mar 28, 2018
不止app.SetExceptionHandle,还包括SetMethodNotAllowedHandle和SetNotFoundHandle @devfeel