diff --git a/addons/web/http.py b/addons/web/http.py index 659927aed9d..8193b21e108 100644 --- a/addons/web/http.py +++ b/addons/web/http.py @@ -947,13 +947,9 @@ class Root(object): if httprequest.args.get('jsonp'): return JsonRequest(httprequest) - content = httprequest.stream.read() - import cStringIO - httprequest.stream = cStringIO.StringIO(content) - try: - simplejson.loads(content) + if httprequest.headers["Content-Type"] == "application/json": return JsonRequest(httprequest) - except: + else: return HttpRequest(httprequest) def load_addons(self):