I am porting a ST1 application and have run into a surprising change in ST2. When I issue an Ext.Ajax.request to a URL and it returns a status of 0, ST2 now considers that to be a success. (ST1 considered it a failure).
This is problematic for my application because status 0 is returned on both Mobile Safari and in Chrome when:
1) The server at the other end does not exist and/or the server is not up and running
2) The request is prevented because of cross-site scripting
I need to detect both of these cases but I can't seem to find a good way of doing it right now.
I wrote a test application you can see here on github: http://goo.gl/NrT7L
The application attempts to request from several different URLs and presents the results.
Results for chrome are:
Results on mobile safari running iOS 5.0.1 are the same.Log:
Touch version: 2.0.0
Browser: Chrome 17.0.963.79
URL: ../../resources/css/app.css expecting: should pass
URL: http://localhost/blah expecting: server not responding
URL: /not_there expecting: file not found
URL: http://servernotthere.com expecting: server does not exist
URL: http://www.google.com expecting: Cross site failure
URL: http://www.google.com/not_there expecting: cross site with bad url
It seems to me that status code 0 should actually be treated as a failure. Is there some reason this change was made for ST2?