javascript - XmlHttpRequest status 0 instead of 401 in IE 10 -
i have hit wall issue. guess kind of ie bug want sure.
so question is. why ie10 xmlhttprequest.status returns 0 instead of 401?
var xmlhttp=new xmlhttprequest(); xmlhttp.onreadystatechange=function() { if (xmlhttp.readystate==4) { document.getelementbyid("rescode").innerhtml="request completed status: "+xmlhttp.status; } } xmlhttp.open("get","http://hosting.gregy.cz/cors/",true); xmlhttp.send();
see plunker here: http://plnkr.co/edit/e2lcflpdhhaqi7t79iem?p=preview
this code fires cors request returns 401. firefox , chrome correctly return 401 in status attribute ie10 returns 0. issue breaks authentication handling methods use project.
thank you
edit:
i have modified plunker onload , onerror event handlers (tip monsur's comment), result still same.
i have made sure ie10 has no compatibility mode selected. (tip cernunnos's comment)
this appears bug in ie10 (https://connect.microsoft.com/ie/feedback/details/785990/ie-10-on-win8-does-not-assign-the-correct-status-to-xmlhttprequest-when-the-result-is-401).
ie10 treating http status 401 network error. console shows:
script7002: xmlhttprequest: network error 0x80070005, access denied
according xmlhttprequest level 2 specification status attribute should 0 if error flag set (for example because of network error). specification states (http://www.w3.org/tr/xmlhttprequest2/#infrastructure-for-the-send-method) network error
does not include http responses indicate type of error, such http status code 410.
i think clear http status 401 should not therefore treated network error (as not in chrome, firefox , safari) , bug in ie10.
Comments
Post a Comment