From c1ba69fa280407f81e0bccc33044459940193df9 Mon Sep 17 00:00:00 2001 From: Christophe de Vienne Date: Thu, 8 Nov 2012 15:02:59 +0100 Subject: [PATCH] args_from_body now ignore empty bodies. --- tox.ini | 2 +- wsme/rest/args.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 6bb632b..25736ee 100644 --- a/tox.ini +++ b/tox.ini @@ -87,5 +87,5 @@ deps= commands= {envbindir}/coverage erase {envbindir}/coverage combine - {envbindir}/coverage xml wsme/*.py wsme/protocols/*.py + {envbindir}/coverage xml wsme/*.py wsme/rest/*.py {envbindir}/coverage report --show-missing wsme/*.py wsme/protocols/*.py diff --git a/wsme/rest/args.py b/wsme/rest/args.py index 85c0fe7..a68849e 100644 --- a/wsme/rest/args.py +++ b/wsme/rest/args.py @@ -153,6 +153,8 @@ def args_from_body(funcdef, body, mimetype): dataformat = restjson elif mimetype in restxml.accept_content_types: dataformat = restxml + elif not body: + return (), {} else: raise ValueError("Unknow mimetype: %s" % mimetype)