From d8a05dbbbf52898117e6467b889dfaaee609413b Mon Sep 17 00:00:00 2001 From: "pzrr@qq.com" Date: Tue, 13 Mar 2018 18:37:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?####=20Version=201.4.9.1=20*=20=E5=86=85?= =?UTF-8?q?=E7=BD=AEVendor=E7=9B=AE=E5=BD=95=E4=BB=85=E4=BF=9D=E7=95=99=20?= =?UTF-8?q?golang.org/x/net=E5=8C=85,=E7=A7=BB=E9=99=A4redis=E4=B8=8Eyaml?= =?UTF-8?q?=E5=8C=85=20*=20=E5=AE=8C=E5=96=84RedisClient=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=83=BD=E5=8A=9B=20*=202018-03-13=2012:00?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9e92ab6..694db11 100644 --- a/README.md +++ b/README.md @@ -271,9 +271,9 @@ type NotFoundHandle func(http.ResponseWriter, *http.Request) ## Dependency websocket - golang.org/x/net/websocket - 内置vendor
-redis - github.com/garyburd/redigo - 需自行go get +redis - github.com/garyburd/redigo - go get自动下载
-yaml - gopkg.in/yaml.v2 - 需自行go get +yaml - gopkg.in/yaml.v2 - go get自动下载 ## 相关项目 #### LongWeb From ee9a7258f37ff4bc6018cc2a215a3fafc220ddf3 Mon Sep 17 00:00:00 2001 From: "pzrr@qq.com" Date: Wed, 28 Mar 2018 09:16:50 +0800 Subject: [PATCH 2/2] =?UTF-8?q?####=20Version=201.4.9.2=20*=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8DBUG=20for=20#112=20*=20=E8=B0=83=E6=95=B4CharsetUTF8?= =?UTF-8?q?=E5=80=BC=E4=B8=BA"charset=3Dutf-8"=20*=202018-03-28=2009:00?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- consts.go | 2 +- example/main.go | 5 +++++ version.MD | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/consts.go b/consts.go index a582bc2..22fc2a6 100644 --- a/consts.go +++ b/consts.go @@ -14,7 +14,7 @@ const ( //Http define const ( - CharsetUTF8 = "text/plain; charset=utf-8" + CharsetUTF8 = "charset=utf-8" DefaultServerName = "dotweb" ) diff --git a/example/main.go b/example/main.go index 19a1424..0862b40 100644 --- a/example/main.go +++ b/example/main.go @@ -58,6 +58,11 @@ func main() { ctx.Response().Write(http.StatusNotFound, []byte("is't app's not found!")) }) + app.SetExceptionHandle(func(ctx dotweb.Context, err error) { + ctx.Response().SetContentType(dotweb.MIMEApplicationJSONCharsetUTF8) + ctx.WriteJsonC(http.StatusInternalServerError, err.Error()) + }) + //设置HttpModule //InitModule(app) diff --git a/version.MD b/version.MD index 8bed871..ae5e981 100644 --- a/version.MD +++ b/version.MD @@ -1,5 +1,10 @@ ## dotweb版本记录: +#### Version 1.4.9.2 +* 修复BUG for #112 +* 调整CharsetUTF8值为"charset=utf-8" +* 2018-03-28 09:00 + #### Version 1.4.9.1 * 内置Vendor目录仅保留 golang.org/x/net包,移除redis与yaml包 * 完善RedisClient接口能力