summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd_external.erl
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2011-04-16 19:19:20 +0000
committerJan Lehnardt <jan@apache.org>2011-04-16 19:19:20 +0000
commitf02041ef74bf356a00c98e220b0841c4b3fbd0a9 (patch)
treef546d506ec9ef66808f428827436c0153e61c5e5 /src/couchdb/couch_httpd_external.erl
parentba7c0c7135bebedbd8aae327535729e8756d7467 (diff)
Don't call mochiweb_util:parse_qs/1 with an undefined argument.
Found this while debugging COUCHDB-1116. Closes COUCHDB-1116 git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1094031 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd_external.erl')
-rw-r--r--src/couchdb/couch_httpd_external.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/couchdb/couch_httpd_external.erl b/src/couchdb/couch_httpd_external.erl
index f8d6f171..2e91fb50 100644
--- a/src/couchdb/couch_httpd_external.erl
+++ b/src/couchdb/couch_httpd_external.erl
@@ -66,7 +66,10 @@ json_req_obj(#httpd{mochi_req=Req,
end,
ParsedForm = case Req:get_primary_header_value("content-type") of
"application/x-www-form-urlencoded" ++ _ ->
- mochiweb_util:parse_qs(Body);
+ case Body of
+ undefined -> [];
+ _ -> mochiweb_util:parse_qs(Body)
+ end;
_ ->
[]
end,