[TIMOB-2535] iOS: XHR getAllResponseHeaders() returns NSDictionary instead of String
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2014-06-24T21:20:35.000+0000 |
| Affected Version/s | Release 2.1.4, Release 3.1.3 |
| Fix Version/s | Release 3.3.0, Release 3.4.0 |
| Components | iOS |
| Labels | module_network, parity, qe-manualtest, qe-testadded |
| Reporter | Bill Dawson |
| Assignee | Pedro Enrique |
| Created | 2011-04-15T03:22:08.000+0000 |
| Updated | 2014-08-15T23:00:43.000+0000 |
Description
I know you guys are going to re-visit XHR compliance in the future, I thought I'd throw this one in because our Android implementation supports it and it's in the spec.
There's already a drillbit test for it in network.httpclient.js (test: responseHeadersBug), but I avoid running the getAllResponseHeaders stuff if it's iphone os, until you implement it. So after you implement it, just take out the if block and - bang! - you've got your drillbit test!
Requesting it to implement as a next feature to support consistency across all platforms. HD Ticket: APP-532487
In Titanium SDK *3.3.0.RC*
HTTPClient#getAllResponseHeadershas been implemented… but in a totally wrong way. It returns aNSDictionaryof headers instead of a string. While it IS a pretty cool feature it should do it with a different name, as it was before (allRespondeHeaders). This is also a feature parity issue with Android. IMHO 3.3.3.*GA* should not ship with this issue.Any info on this?
Test case
var win = Ti.UI.createWindow(); var btn = Ti.UI.createButton({ title: 'here' }); btn.addEventListener('click', function(){ var xhr = Ti.Network.createHTTPClient(); xhr.onload = function() { Ti.API.info('--------------------'); Ti.API.info(this.getAllResponseHeaders()); Ti.API.info('--------------------'); }; xhr.open('GET', 'http://google.com'); xhr.send(); }); win.add(btn); win.open();Result should be in parity with Android:
PR
Master: https://github.com/appcelerator/titanium_mobile/pull/5843 3_3_X https://github.com/appcelerator/titanium_mobile/pull/5844Verified fixed on: Mac OSX 10.9.3 Appcelerator Studio, build: 3.3.0.201406271159 Titanium SDK, build: 3.3.0.v20140627202512 Titanium CLI, build: 3.3.0-rc4 iOS Device: iPad Air (7.1.1) iOS output is in parity with Android:
Closing.