File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed 
modules/angular2/src/render Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,22 @@ export class XHRImpl extends XHR {
1111 xhr . responseType  =  'text' ; 
1212
1313 xhr . onload  =  function ( )  { 
14-  var  status  =  xhr . status ; 
14+  // responseText is the old-school way of retrieving response (supported by IE8 & 9) 
15+  // response/responseType properties were introduced in XHR Level2 spec (supported by IE10) 
16+  var  response  =  ( 'response'  in  xhr )  ? xhr . response  : xhr . responseText ; 
17+ 
18+  // normalize IE9 bug (http://bugs.jquery.com/ticket/1450) 
19+  var  status  =  xhr . status  ===  1223  ? 204  : xhr . status ; 
20+ 
21+  // fix status code when it is 0 (0 status is undocumented). 
22+  // Occurs when accessing file resources or on Android 4.1 stock browser 
23+  // while retrieving files from application cache. 
24+  if  ( status  ===  0 )  { 
25+  status  =  response  ? 200  : 0 ; 
26+  } 
27+ 
1528 if  ( 200  <=  status  &&  status  <=  300 )  { 
16-  completer . resolve ( xhr . responseText ) ; 
29+  completer . resolve ( response ) ; 
1730 }  else  { 
1831 completer . reject ( `Failed to load ${ url }  ,  null ) ; 
1932 } 
                         You can’t perform that action at this time. 
           
                  
0 commit comments