remove debug
This commit is contained in:
parent
13dc619abe
commit
93e1343dc4
|
@ -7,7 +7,6 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewDataset() *DataSet {
|
func NewDataset() *DataSet {
|
||||||
|
@ -91,37 +90,27 @@ func (i *DataSet) fetchGet(req *http.Request) {
|
||||||
// - parse 'application/json'
|
// - parse 'application/json'
|
||||||
func (i *DataSet) fetchForm(req *http.Request) {
|
func (i *DataSet) fetchForm(req *http.Request) {
|
||||||
|
|
||||||
fmt.Printf("Parsing FORM...")
|
|
||||||
startn := time.Now().UnixNano()
|
|
||||||
|
|
||||||
contentType := req.Header.Get("Content-Type")
|
contentType := req.Header.Get("Content-Type")
|
||||||
|
|
||||||
// parse json
|
// parse json
|
||||||
if strings.HasPrefix(contentType, "application/json") {
|
if strings.HasPrefix(contentType, "application/json") {
|
||||||
i.parseJson(req)
|
i.parseJson(req)
|
||||||
|
|
||||||
fmt.Printf("* %.3f us\n", float64(time.Now().UnixNano()-startn)/1e3)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// parse urlencoded
|
// parse urlencoded
|
||||||
if strings.HasPrefix(contentType, "application/x-www-form-urlencoded") {
|
if strings.HasPrefix(contentType, "application/x-www-form-urlencoded") {
|
||||||
i.parseUrlencoded(req)
|
i.parseUrlencoded(req)
|
||||||
|
|
||||||
fmt.Printf("* %.3f us\n", float64(time.Now().UnixNano()-startn)/1e3)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// parse multipart
|
// parse multipart
|
||||||
if strings.HasPrefix(contentType, "multipart/form-data; boundary=") {
|
if strings.HasPrefix(contentType, "multipart/form-data; boundary=") {
|
||||||
i.parseMultipart(req)
|
i.parseMultipart(req)
|
||||||
|
|
||||||
fmt.Printf("* %.3f us\n", float64(time.Now().UnixNano()-startn)/1e3)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// if unknown type store nothing
|
// if unknown type store nothing
|
||||||
fmt.Printf("* %.3f us\n", float64(time.Now().UnixNano()-startn)/1e3)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// parseJson parses JSON from the request body inside 'Form'
|
// parseJson parses JSON from the request body inside 'Form'
|
||||||
|
|
Loading…
Reference in New Issue