[FIX] Potential problems with server-side autodetection of request type.
bzr revid: nicolas.vanhoren@openerp.com-20130806152547-2b5puachpvcjsci3
This commit is contained in:
parent
8039768fc8
commit
67cba2d9c5
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue