add debug to debug body parsers

This commit is contained in:
Adrien Marquès 2018-09-26 07:35:53 +02:00
parent 592ed23638
commit 0974658bf2
1 changed files with 9 additions and 2 deletions

View File

@ -124,6 +124,7 @@ func (i *DataSet) parseJSON(req *http.Request) {
// if parse error: do nothing // if parse error: do nothing
if err := decoder.Decode(&parsed); err != nil { if err := decoder.Decode(&parsed); err != nil {
log.Printf("json.parse() %s\n", err)
return return
} }
@ -154,7 +155,10 @@ func (i *DataSet) parseJSON(req *http.Request) {
func (i *DataSet) parseUrlencoded(req *http.Request) { func (i *DataSet) parseUrlencoded(req *http.Request) {
// use http.Request interface // use http.Request interface
req.ParseForm() if err := req.ParseForm(); err != nil {
log.Printf("urlencoded.parse() %s\n", err)
return
}
for name, value := range req.PostForm { for name, value := range req.PostForm {
@ -188,7 +192,10 @@ func (i *DataSet) parseMultipart(req *http.Request) {
} }
/* (2) Parse multipart */ /* (2) Parse multipart */
mpr.Parse() if err = mpr.Parse(); err != nil {
log.Printf("multipart.parse() %s\n", err)
return
}
/* (3) Store data into 'Form' and 'Set */ /* (3) Store data into 'Form' and 'Set */
for name, data := range mpr.Data { for name, data := range mpr.Data {