AlexStocks commented on a change in pull request #236:
URL: https://github.com/apache/dubbo-go-pixiu/pull/236#discussion_r684608518
##########
File path: pkg/context/http/util.go
##########
@@ -84,3 +88,31 @@ func HttpRouteActionMatch(c *HttpContext, ra
model.RouteAction) bool {
return true
}
+
+// 将request.body写入到span中,并重新放回去
+func ExtractRequestBody(req *http.Request) []byte {
+ isUpload := isUpload(req)
+ if isUpload {
+ return nil
+ }
+ body, err := ioutil.ReadAll(req.Body)
+ if err != nil {
+ return nil
+ }
+ req.Body = ioutil.NopCloser(bytes.NewBuffer(body))
+ return body
+}
+
+// 是否为文件上传 upload方法
Review comment:
using english comment, pls.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]