IE9 XMLHTTPRequest request body incomplete but readyState=4 statuscode=200

Viewed 815

I have an issue in IE9 where the request body of an XMLHTTPRequest is incomplete.

The code that handles the XMLHTTPRequest waits for readyState=4, then checks statuscode=200. It will then proceed to JSON.parse but that fails because the request body is incomplete. When I inspect the request body I can clearly see that it's cut-off at some point in the string, like in the middle of a property.

Server-side there is very little to check, it's just a matter of echo json_encode($reply);

I know AJAX errors can come from a wide range of sources, like: over-eager firewalls, but that would be accompanied by a proper status like (like 403). In this case the XMLHTTPRequest response seems to think everything is fine so I don't know how to detect it. Is there another property I can check, or does IE9 perhaps cut off long response bodies?

I will continue to investigate this, but as I can't not reproduce it myself this may take a couple of days.

Can anyone confirm these issues and perhaps point me to a solution?

Note: This only seems to occur in IE9, I suppose that's because older versions don't use XMLHTTPRequest but ActiveXObject. This does not occur in Chrome or Firefox, at least: I haven't seen it.

1 Answers
Related