do not parse content if GET

This commit is contained in:
Adrien Marquès 2018-05-24 16:18:14 +02:00
parent 276268f1be
commit 296234d6e7
1 changed files with 5 additions and 0 deletions

View File

@ -96,6 +96,11 @@ func FetchFormData(req *http.Request) map[string]interface{} {
res := make(map[string]interface{}) res := make(map[string]interface{})
// Abort if GET request
if req.Method == "GET" {
return res
}
ct := req.Header.Get("Content-Type") ct := req.Header.Get("Content-Type")
if strings.HasPrefix(ct, "application/json") { if strings.HasPrefix(ct, "application/json") {