[TIMOB-16689] iOS: HTTPClient - On SDK 3.3.0, statusText is returning undefined if you are making an invalid request
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-05-21T22:36:07.000+0000 |
Affected Version/s | Release 3.3.0 |
Fix Version/s | 2014 Sprint 10, 2014 Sprint 10 SDK, Release 3.3.0, Release 3.4.0 |
Components | iOS |
Labels | module_network, qe-3.3.0, qe-manualtest, qe-testadded, regression |
Reporter | Wilson Luu |
Assignee | Vishal Duggal |
Created | 2014-03-25T00:47:37.000+0000 |
Updated | 2014-08-15T22:58:57.000+0000 |
Description
*Details:* On SDK 3.3.0 with iOS, statusText is returning undefined if you are making an invalid request.
*This is a regression from SDK 3.2.3 and bug does not occur on Android.*
*Steps to reproduce:*
1. Create a default Titanium Classic app
2. Add this piece of code:
label1.addEventListener('click', function(e){
// accepts only POST requests
var url = 'http://httpbin.org/post';
var client = Ti.Network.createHTTPClient({
onload : function(e) {
var msg = 'onload: ' + this.responseText;
Ti.API.info(msg);
alert(msg);
},
onerror : function(e) {
// var msg = 'onerror: ' + 'error code -> ' + e.code + ', error -> ' + e.error;
var msg = 'onerror: ' + this.statusText;
Ti.API.error(msg);
alert(msg);
},
cache: false
});
client.open('DELETE', url);
client.send('DELETE THE MONKEY');
});
3. Install and launch app to device
4. Press on "I am Window 1" label
*Actual:* "undefined" is returned in the onerror callback (see 3.3.0_actual.png).
*Expected:* "METHOD NOT ALLOWED" message should appear like in SDK 3.2.3 (see 3.2.3_expected.png)
Attachments
File | Date | Size |
---|---|---|
3.2.3_expected.png | 2014-03-25T00:47:37.000+0000 | 63256 |
3.3.0_actual.png | 2014-03-25T00:47:37.000+0000 | 56978 |
Pull pending master - https://github.com/appcelerator/titanium_mobile/pull/5722 3_3_X - https://github.com/appcelerator/titanium_mobile/pull/5723
StatusText in onerror callback returns the expected value. Verified on: || Component || Version || | Appcelerator Studio | 3.3.0.201405271647 | | Titanium SDK | 3.3.0.v20140606154912 | | Node | 0.10.28 | | acs | 1.0.14 | | alloy | 1.4.0-beta2 | | npm | 1.4.9 | | CLI | 3.3.0-beta2 | | Titanium-code-processor | 1.1.1 | | OS | OSX 10.9.2 | | Device | iPhone 5S (iOS 7.1) |