PDA

View Full Version : Android 2.3.3. JSON bug (JSON string twice in responseText)



sieppl
29 Dec 2011, 8:17 AM
Hi all,

we bumped in a very strange bug on Android 2.3.3.
All ajax calls that expect a JSON object fail with "Unable to parse the JSON returned by the server.." due to a doubled JSON string. So instead of

{"key":"value"}
the reponseText contains

{"key":"value"}{"key":"value"}
On Android 2.1 and Android 3.1 this problem does not occur.

Can anybody confirm this behavior?

Best Regards
Sebastian

mitchellsimoens
29 Dec 2011, 8:57 AM
The response has the double object? If so then that is not valid JSON and therefor not consumable.

sieppl
29 Dec 2011, 9:34 AM
The response has the double object? If so then that is not valid JSON and therefor not consumable.
Yes, correct. The bug occurs due to an OPTION request sent (http://www.sencha.com/forum/showthread.php?162841-REST-Model-Store-Proxy-calls-with-OPTIONS) in chrome browsers. We fixed this by

Ext.Ajax.useDefaultXhrHeader = false; and responding only to POST and GET on ther server.