summaryrefslogtreecommitdiff
path: root/addons/web/http.py
diff options
context:
space:
mode:
authorniv-openerp <nicolas.vanhoren@openerp.com>2013-08-06 17:25:47 +0200
committerniv-openerp <nicolas.vanhoren@openerp.com>2013-08-06 17:25:47 +0200
commit67cba2d9c5213843f311fe080403a4795cdbd22d (patch)
treee85bb184471aa888b52504f9d462b95686cbef5f /addons/web/http.py
parent8039768fc8a8dbd12c4d4caadd2a1c1381397843 (diff)
[FIX] Potential problems with server-side autodetection of request type.
bzr revid: nicolas.vanhoren@openerp.com-20130806152547-2b5puachpvcjsci3
Diffstat (limited to 'addons/web/http.py')
-rw-r--r--addons/web/http.py8
1 files 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):