Skip to content

Commit 1f7c0bd

Browse files
realitykingbullgare
authored andcommitted
refactor($http) Simplify code by removing workarounds for older versions of Internet Explorer
This removes a workaround for IE 8 and and error handling for IE6. Closes angular#9300
1 parent f87c7ef commit 1f7c0bd

File tree

2 files changed

+3
-23
lines changed

2 files changed

+3
-23
lines changed

docs/content/error/$httpBackend/noxhr.ngdoc

-10
This file was deleted.

src/ng/httpBackend.js

+3-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
'use strict';
22

3-
function createXhr(method) {
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 (msie <= 8 && (!method.match(/^(get|post|head|put|delete|options)$/i) ||
8-
!window.XMLHttpRequest)) {
9-
return new window.ActiveXObject("Microsoft.XMLHTTP");
10-
} else if (window.XMLHttpRequest) {
11-
return new window.XMLHttpRequest();
12-
}
13-
14-
throw minErr('$httpBackend')('noxhr', "This browser does not support XMLHttpRequest.");
3+
function createXhr() {
4+
return new window.XMLHttpRequest();
155
}
166

177
/**
@@ -59,7 +49,7 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
5949
});
6050
} else {
6151

62-
var xhr = createXhr(method);
52+
var xhr = createXhr();
6353

6454
xhr.open(method, url, true);
6555
forEach(headers, function(value, key) {

0 commit comments

Comments
 (0)