[TIMOB-19129] Windows: HTTPClient does not send User-Agent
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | None |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-07-07T18:31:29.000+0000 |
Affected Version/s | Release 4.1.0 |
Fix Version/s | Release 5.0.0 |
Components | Windows |
Labels | n/a |
Reporter | Fokke Zandbergen |
Assignee | Christopher Williams |
Created | 2015-07-01T11:04:38.000+0000 |
Updated | 2015-09-03T21:51:21.000+0000 |
Description
The following example shows that on Windows is not sending the
User-Agent
header (as well as X-Titanium-Id
) like iOS and Android do. Many API's require this header to be set.
var win = Ti.UI.createWindow();
var btn = Ti.UI.createButton({
title: 'Click'
});
btn.addEventListener('click', function (e) {
var client = Ti.Network.createHTTPClient();
client.open('GET', 'http://requestb.in/1fv1js61');
client.send();
});
win.add(btn);
win.open();
Windows
Host: requestb.in
Connection: close
X-Request-Id: 94581c18-95ea-468a-966d-0cf914d68859
Via: 1.1 vegur
Total-Route-Time: 0
Connect-Time: 0
Accept-Encoding: gzip, deflate
iOS
User-Agent: Appcelerator Titanium/4.1.0 (iPhone/8.4; iPhone OS; nl_NL;)
Via: 1.1 vegur
Connection: close
Accept: */*
Accept-Language: nl-nl
X-Request-Id: 600421ac-e5e7-4d10-9c48-2eabfab4489b
Connect-Time: 1
Host: requestb.in
Total-Route-Time: 0
X-Titanium-Id: 92e3ee1a-2507-4c54-b3a0-3af19ccf0661
Accept-Encoding: gzip, deflate
X-Requested-With: XMLHttpRequest
Android
X-Request-Id: e5cd2daa-9796-478f-924c-e8578edd6cdd
X-Requested-With: XMLHttpRequest
X-Titanium-Id: 92e3ee1a-2507-4c54-b3a0-3af19ccf0661
Connection: close
Host: requestb.in
Via: 1.1 vegur
Total-Route-Time: 0
User-Agent: Appcelerator Titanium/4.0.0 (Nexus 5; Android API Level: 22; nl-NL;)
Connect-Time: 0
Verified using: Windows 8.1 Appc CLI Core: 5.0.0-33 Appc CLI NPM: 4.2.0-1 Titanium SDK: 5.0.0.v20150902095518 Nokia Lumia 930 8.1 HTTPClient now sends the user agent
Closing ticket