[TIMOB-6828] iOS: Setting request header in HTTPClient to null throws exception
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-07-01T18:49:55.000+0000 |
Affected Version/s | Release 1.8.0.1, Release 2.0.0, Release 3.3.0 |
Fix Version/s | Sprint 2011-51, Release 2.0.0, Release 1.8.1, Release 3.3.0, Release 3.4.0 |
Components | iOS |
Labels | module_network, qe-manualtest, qe-testadded, regression |
Reporter | Blain Hamon |
Assignee | Vishal Duggal |
Created | 2011-12-21T14:19:46.000+0000 |
Updated | 2014-08-15T22:59:25.000+0000 |
Description
During the ASI library upgrade, one of our patches (The one for 890), slipped through the cracks and was not reinstated. The end result is that setRequestHeader(,null) throws an exception instead fo removing the header as documented. To recreate:
var xhr = Titanium.Network.createHTTPClient();
xhr.onerror = function(e){Ti.API.info("ERROR " + e.error);};
xhr.onload = function(){Ti.API.info("Loaded");};
xhr.open('GET','http://www.appcelerator.com');
xhr.setRequestHeader('Authorization',null);
xhr.send();
The fix for 4691 caused this regression.
Closing issue Tested with Ti Studio 1.0.8.201201101928 Ti Mob SDK 1.9.0.v20120111233134 OSX Lion iPhone 4S, iPad 2 Expected behavior is shown of setting request header to null not causing an exception
Anvil test case added. PR link: https://github.com/appcelerator/titanium_mobile/pull/5011
Issue is reproducible, reopening the issue. It works fine on 3.2.3.GA SDK. Runtime Error occurs as " setObjectForKey: object cannot be nil (Key: Authorization) at app.js (line 1) " Environment used: Tested on: Device : iPhone 5s , iOS version : 7.1.1 SDK: 3.3.0.v20140623161712 CLI version : 3.3.0-rc2 OS : MAC OSX 10.9.2 Alloy: 1.4.0-rc2 ACS: 1.0.14 npm:1.3.2 LiveView: 1.0.4 Appcelerator Studio, build: 3.3.0.201406231625 titanium-code-processor: 1.1.1 XCode : 5.1.1 code used
Pull pending APSHTTPClient - https://github.com/appcelerator/APSHTTPClient/pull/15 titanium mobile master - https://github.com/appcelerator/titanium_mobile/pull/5874 3_3_X - https://github.com/appcelerator/titanium_mobile/pull/5875
Verified fixed on: Appcelerator Studio, build: 3.3.0.201406271159 Titanium SDK, build: 3.3.0.v20140703093313 Titanium CLI, build: 3.3.0-rc4 Alloy: 1.4.0-rc3 iOS Simulator: iPad (7.1) iOS Device: iPhone 5 (7.0.6) Exception is not thrown using the test code provided. Closing.