From 67cba2d9c5213843f311fe080403a4795cdbd22d Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 6 Aug 2013 17:25:47 +0200 Subject: [PATCH] [FIX] Potential problems with server-side autodetection of request type. bzr revid: nicolas.vanhoren@openerp.com-20130806152547-2b5puachpvcjsci3 --- addons/web/http.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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):