Explorar el Código

将数据转成字符串

dcsunny hace 4 años
padre
commit
db92527ad4
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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 {
 	b, _ := ioutil.ReadAll(r.Body)
 	if len(b) > 0 {
-		ctx = context2.AppendToContext(ctx, "body", b)
+		ctx = context2.AppendToContext(ctx, "body", string(b))
 	}
 	return ctx
 }