Commits

Robert Brewer committed 6e33261

Better json_in default_proc.

  • Participants
  • Parent commits 87a187b

Comments (0)

Files changed (1)

File cherrypy/lib/jsontools.py

             raise cherrypy.HTTPError(400, 'Invalid JSON document')
     if force:
         request.body.processors.clear()
-        def default_proc():
-            # Leave the fp alone for someone else to read. This works fine
-            # for request.body, but the Part subclasses need to override this
-            # so they can move on to the next part.
-            raise cherrypy.HTTPError(
-                415, 'Expected an application/json content type')
-        request.body.default_proc = default_proc
+        request.body.default_proc = cherrypy.HTTPError(
+            415, 'Expected an application/json content type')
     request.body.processors[u'application/json'] = json_processor
 
 def json_out(debug=False):