dcsunny 4 年之前
父节点
当前提交
dd3907fa65
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      http/handle.go

+ 1 - 1
http/handle.go

@@ -217,7 +217,7 @@ func contentSubtype(contentType string) string {
 func SetBody(ctx context.Context, r *http.Request) context.Context {
 func SetBody(ctx context.Context, r *http.Request) context.Context {
 	b, _ := ioutil.ReadAll(r.Body)
 	b, _ := ioutil.ReadAll(r.Body)
 	if len(b) > 0 {
 	if len(b) > 0 {
-		ctx = context2.AppendToContext(ctx, "body", r.Body)
+		ctx = context2.AppendToContext(ctx, "body", string(b))
 	}
 	}
 	return ctx
 	return ctx
 }
 }