0

I am having a curious behaviour when it comes to XHR on a Windows phone (8.1, a Lumia 925).

I'm using a javascript library to perform some XHR requests (the Tin Can JS library), and it performs a PUT to an external URL setting some headers. If I run the very same code as a web page on IE11, the request sends these headers:

Accept: */*, referer: http://169.254.80.80:8080/dest/
Authorization: Basic YTQwMTlhY2VlZTAyNTNmYjE4N2Q1ZTEwN2FiMWZhYWU5MmE5ZTk4YjozMWQ3OWZkMWI0NzU1OGMyNDdiMTlmNTVlN2VhZTgzNzNiNTk5NDBl, referer: http://169.254.80.80:8080/dest/
X-Experience-API-Version: 1.0.1, referer: http://169.254.80.80:8080/dest/
Content-Type: application/json, referer: http://169.254.80.80:8080/dest/
Referer: http://169.254.80.80:8080/dest/, referer: http://169.254.80.80:8080/dest/
Accept-Language: en-GB, referer: http://169.254.80.80:8080/dest/
Origin: http://169.254.80.80:8080, referer: http://169.254.80.80:8080/dest/
Accept-Encoding: gzip, deflate, referer: http://169.254.80.80:8080/dest/
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko, referer: http://169.254.80.80:8080/dest/
Host: testsrv.greenteam.it, referer: http://169.254.80.80:8080/dest/
Content-Length: 568, referer: http://169.254.80.80:8080/dest/
DNT: 1, referer: http://169.254.80.80:8080/dest/
Connection: Keep-Alive, referer: http://169.254.80.80:8080/dest/
Cache-Control: no-cache, referer: http://169.254.80.80:8080/dest/

If I run it on the Windows Phone, wrapped by Cordova, these are the headers:

Connection: Keep-Alive
Content-Length: 568
Reverse-Via: SRVGATEWAY
Content-Type: application/json
User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 925)
Host: testsrv.greenteam.it
Accept: */*
X-Experience-API-Version: 1.0.1
Accept-Language: en-US,en;q=0.8,it-IT;q=0.5,it;q=0.3
UA-CPU: ARM
Cache-Control: no-cache

What is notably missing is the Authorization header. I checked by console.log, and the appropriate xhr.setRequestHeader are performed even on the windows phone, but it seems like the header is thrown away or ignored.

I can't find what the cause of this may be, or a workaround.

RedGlow
  • 773
  • 7
  • 13
  • Have you confirmed whether the XMLHttpRequest or XDomainRequest functions are being used by TinCanJS? See https://github.com/RusticiSoftware/TinCanJS/blob/master/src/Environment/Browser.js#L200 – Andrew Downes Jun 05 '15 at 10:50
  • I checked, XMLHttpRequest is used. – RedGlow Jun 05 '15 at 11:43
  • @RedGlow we'd probably need to see code. Are you using the `TinCan` interface or `TinCan.LRS` interface and how are you setting up the username+password? It may also help to turn on logging using `TinCan.enableDebug()` before your first access into the `TinCan` interface (even its parts) though I don't know what the console looks like for that platform, you'll see the types of messages it activates in the IE dev tools console. – Brian J. Miller Jun 06 '15 at 13:54

0 Answers0