]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: restcontroller: allow POST with empty body
authorRicardo Dias <rdias@suse.com>
Wed, 11 Apr 2018 22:20:11 +0000 (23:20 +0100)
committerRicardo Dias <rdias@suse.com>
Fri, 13 Apr 2018 14:58:47 +0000 (15:58 +0100)
Signed-off-by: Ricardo Dias <rdias@suse.com>
src/pybind/mgr/dashboard/controllers/__init__.py

index c0cef53c1e598899eb9f305f69fb52501bc4cac7..d695578c6cba4e333e36f18f96636a7916158279 100644 (file)
@@ -441,8 +441,8 @@ class RESTController(BaseController):
             content_length = int(cherrypy.request.headers['Content-Length'])
             body = cherrypy.request.body.read(content_length)
             if not body:
-                raise cherrypy.HTTPError(400, 'Empty body. Content-Length={}'
-                                         .format(content_length))
+                return func(*args, **kwargs)
+
             try:
                 data = json.loads(body.decode('utf-8'))
             except Exception as e: