File tree 1 file changed +12
-6
lines changed
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
3
function createXhr ( method ) {
4
- // IE8 doesn't support PATCH method, but the ActiveX object does
5
- /* global ActiveXObject */
6
- return ( ( msie <= 8 && lowercase ( method ) === 'patch' ) || isUndefined ( window . XMLHttpRequest ) )
7
- ? new ActiveXObject ( 'Microsoft.XMLHTTP' )
8
- : new window . XMLHttpRequest ( ) ;
9
- }
4
+ //if IE and the method is not RFC2616 compliant, or if XMLHttpRequest
5
+ //is not available, try getting an ActiveXObject. Otherwise, use XMLHttpRequest
6
+ //if it is available
7
+ if ( ( window . ActiveXObject && ! method . match ( / ^ ( g e t | p o s t | h e a d | p u t | d e l e t e | o p t i o n s ) $ / i) )
8
+ || ! window . XMLHttpRequest ) {
9
+
10
+ return new ActiveXObject ( "Microsoft.XMLHTTP" ) ;
11
+ } else if ( window . XMLHttpRequest ) {
12
+ return new window . XMLHttpRequest ( ) ;
13
+ }
10
14
15
+ throw $httpMinErr ( 'noxhr' , 'This browser does not support XMLHttpRequest.' ) ;
16
+ }
11
17
12
18
/**
13
19
* @ngdoc object
You can’t perform that action at this time.
0 commit comments