Skip to content

Commit 0c65bf4

Browse files
author
Denis Rechkunov
committed
Merge branch 'release/4.2.0'
2 parents f0a3fcc + 134167f commit 0c65bf4

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

browser/UHR.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ UHR.prototype._doRequest = function (parameters) {
109109
requestError = new Error(xhr.statusText || ERROR_CONNECTION);
110110
reject(requestError);
111111
};
112-
xhr.onloadend = function () {
112+
xhr.onreadystatechange = function () {
113+
if (xhr.readyState !== 4) {
114+
return;
115+
}
113116
if (requestError) {
114117
return;
115118
}
@@ -180,8 +183,9 @@ function getStatusObject(xhr) {
180183
});
181184

182185
return {
183-
code: xhr.status,
184-
text: xhr.statusText,
186+
// handle IE9 bug: http://goo.gl/idspSr
187+
code: xhr.status === 1223 ? 204 : xhr.status,
188+
text: xhr.status === 1223 ? 'No Content' : xhr.statusText,
185189
headers: headers
186190
};
187191
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "catberry-uhr",
3-
"version": "4.1.1",
3+
"version": "4.2.0",
44
"author": "Denis Rechkunov <denis.rechkunov@gmail.com>",
55
"description": "Universal HTTP(S) Request module for catberry framework",
66
"homepage": "https://github.com/catberry/catberry-uhr",

0 commit comments

Comments
 (0)