request请求Content-Type为multipart/form-data时,返回r.GetRequestMap()获取数据会意外得到表单的body原始信息.
{
"----------------------------675405739396733188684112\r\nC ontent-Disposition:_form-data;_name": "\"passport\"\r\n\r\nxxx\r\n----------------------------675405739396733188684112\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\n123456\r\n----------------------------6754057 39396733188684112--\r\n",
"passport": "xxx",
"password": "123456"
}
原因猜测: request解析时parseBody[ghttp_requestparam.go:243]执行了r.bodyMap, = gstr.Parse(r.GetBodyString()) 将body按等号切割成了kv赋值给了bodyMap对象,GetRequestMap()[ghttp_request_param_request.go:97]获取时将r.xxxMap全部合并导致body原始信息出现在返回对象中.