diff options
| author | niv-openerp <nicolas.vanhoren@openerp.com> | 2013-08-06 17:25:47 +0200 |
|---|---|---|
| committer | niv-openerp <nicolas.vanhoren@openerp.com> | 2013-08-06 17:25:47 +0200 |
| commit | 67cba2d9c5213843f311fe080403a4795cdbd22d (patch) | |
| tree | e85bb184471aa888b52504f9d462b95686cbef5f /addons/web/http.py | |
| parent | 8039768fc8a8dbd12c4d4caadd2a1c1381397843 (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.py | 8 |
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): |
