Skip to content

Commit eb432aa

Browse files
committed
admin: updated dist files
1 parent 617714d commit eb432aa

28 files changed

+167
-127
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ Changelog
44
This change log is managed by `admin/cmds/update-versions` but may be manually updated.
55

66

7-
ethers/v5.5.2 (2021-11-30 11:11)
7+
ethers/v5.5.2 (2021-11-30 19:16)
88
--------------------------------
99

10+
- Fixed test case for getAvatar; url has moved ([617714d](https://github.com/ethers-io/ethers.js/commit/617714d19632c7b4789f042ef8357f858421fbae))
11+
- Added basic redirect support. ([42784b8](https://github.com/ethers-io/ethers.js/commit/42784b8d38a96170d19ea8adcbc42ebf7415804c))
1012
- Added arbitrum and optimism to networks and providers. ([#2335](https://github.com/ethers-io/ethers.js/issues/2335); [0844de4](https://github.com/ethers-io/ethers.js/commit/0844de4eb45eb4170fafb6f2a239b53b6be22f1c))
1113
- Added support for data URLs for avatar metadata. ([b8391b0](https://github.com/ethers-io/ethers.js/commit/b8391b0e61bf3627702668920c4fd6506f9bdc60))
1214
- Fixed getAvatar for unconfigured ENS names. ([1e1c93e](https://github.com/ethers-io/ethers.js/commit/1e1c93effa083765be52f3dee10400a9b3eeb003))

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ethers/dist/ethers.esm.js

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17736,24 +17736,34 @@ function _fetchData(connection, body, processFunc) {
1773617736
let response = null;
1773717737
try {
1773817738
response = yield getUrl(url, options);
17739-
// Exponential back-off throttling
17740-
if (response.statusCode === 429 && attempt < attemptLimit) {
17741-
let tryAgain = true;
17742-
if (throttleCallback) {
17743-
tryAgain = yield throttleCallback(attempt, url);
17739+
if (attempt < attemptLimit) {
17740+
if (response.statusCode === 301 || response.statusCode === 302) {
17741+
// Redirection; for now we only support absolute locataions
17742+
const location = response.headers.location || "";
17743+
if (options.method === "GET" && location.match(/^https:/)) {
17744+
url = response.headers.location;
17745+
continue;
17746+
}
1774417747
}
17745-
if (tryAgain) {
17746-
let stall = 0;
17747-
const retryAfter = response.headers["retry-after"];
17748-
if (typeof (retryAfter) === "string" && retryAfter.match(/^[1-9][0-9]*$/)) {
17749-
stall = parseInt(retryAfter) * 1000;
17748+
else if (response.statusCode === 429) {
17749+
// Exponential back-off throttling
17750+
let tryAgain = true;
17751+
if (throttleCallback) {
17752+
tryAgain = yield throttleCallback(attempt, url);
1775017753
}
17751-
else {
17752-
stall = throttleSlotInterval * parseInt(String(Math.random() * Math.pow(2, attempt)));
17754+
if (tryAgain) {
17755+
let stall = 0;
17756+
const retryAfter = response.headers["retry-after"];
17757+
if (typeof (retryAfter) === "string" && retryAfter.match(/^[1-9][0-9]*$/)) {
17758+
stall = parseInt(retryAfter) * 1000;
17759+
}
17760+
else {
17761+
stall = throttleSlotInterval * parseInt(String(Math.random() * Math.pow(2, attempt)));
17762+
}
17763+
//console.log("Stalling 429");
17764+
yield staller(stall);
17765+
continue;
1775317766
}
17754-
//console.log("Stalling 429");
17755-
yield staller(stall);
17756-
continue;
1775717767
}
1775817768
}
1775917769
}

packages/ethers/dist/ethers.esm.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ethers/dist/ethers.esm.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ethers/dist/ethers.esm.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ethers/dist/ethers.umd.js

Lines changed: 43 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19818,30 +19818,39 @@
1981819818
})();
1981919819
var runningFetch = (function () {
1982019820
return __awaiter(this, void 0, void 0, function () {
19821-
var attempt, response, tryAgain, stall, retryAfter, error_1, body_1, result, error_2, tryAgain, timeout_1;
19821+
var attempt, response, location_1, tryAgain, stall, retryAfter, error_1, body_1, result, error_2, tryAgain, timeout_1;
1982219822
return __generator(this, function (_a) {
1982319823
switch (_a.label) {
1982419824
case 0:
1982519825
attempt = 0;
1982619826
_a.label = 1;
1982719827
case 1:
19828-
if (!(attempt < attemptLimit)) return [3 /*break*/, 19];
19828+
if (!(attempt < attemptLimit)) return [3 /*break*/, 20];
1982919829
response = null;
1983019830
_a.label = 2;
1983119831
case 2:
19832-
_a.trys.push([2, 8, , 9]);
19832+
_a.trys.push([2, 9, , 10]);
1983319833
return [4 /*yield*/, (0, browserGeturl.getUrl)(url, options)];
1983419834
case 3:
1983519835
response = _a.sent();
19836-
if (!(response.statusCode === 429 && attempt < attemptLimit)) return [3 /*break*/, 7];
19836+
if (!(attempt < attemptLimit)) return [3 /*break*/, 8];
19837+
if (!(response.statusCode === 301 || response.statusCode === 302)) return [3 /*break*/, 4];
19838+
location_1 = response.headers.location || "";
19839+
if (options.method === "GET" && location_1.match(/^https:/)) {
19840+
url = response.headers.location;
19841+
return [3 /*break*/, 19];
19842+
}
19843+
return [3 /*break*/, 8];
19844+
case 4:
19845+
if (!(response.statusCode === 429)) return [3 /*break*/, 8];
1983719846
tryAgain = true;
19838-
if (!throttleCallback) return [3 /*break*/, 5];
19847+
if (!throttleCallback) return [3 /*break*/, 6];
1983919848
return [4 /*yield*/, throttleCallback(attempt, url)];
19840-
case 4:
19841-
tryAgain = _a.sent();
19842-
_a.label = 5;
1984319849
case 5:
19844-
if (!tryAgain) return [3 /*break*/, 7];
19850+
tryAgain = _a.sent();
19851+
_a.label = 6;
19852+
case 6:
19853+
if (!tryAgain) return [3 /*break*/, 8];
1984519854
stall = 0;
1984619855
retryAfter = response.headers["retry-after"];
1984719856
if (typeof (retryAfter) === "string" && retryAfter.match(/^[1-9][0-9]*$/)) {
@@ -19852,12 +19861,12 @@
1985219861
}
1985319862
//console.log("Stalling 429");
1985419863
return [4 /*yield*/, staller(stall)];
19855-
case 6:
19864+
case 7:
1985619865
//console.log("Stalling 429");
1985719866
_a.sent();
19858-
return [3 /*break*/, 18];
19859-
case 7: return [3 /*break*/, 9];
19860-
case 8:
19867+
return [3 /*break*/, 19];
19868+
case 8: return [3 /*break*/, 10];
19869+
case 9:
1986119870
error_1 = _a.sent();
1986219871
response = error_1.response;
1986319872
if (response == null) {
@@ -19869,8 +19878,8 @@
1986919878
url: url
1987019879
});
1987119880
}
19872-
return [3 /*break*/, 9];
19873-
case 9:
19881+
return [3 /*break*/, 10];
19882+
case 10:
1987419883
body_1 = response.body;
1987519884
if (allow304 && response.statusCode === 304) {
1987619885
body_1 = null;
@@ -19886,34 +19895,34 @@
1988619895
url: url
1988719896
});
1988819897
}
19889-
if (!processFunc) return [3 /*break*/, 17];
19890-
_a.label = 10;
19891-
case 10:
19892-
_a.trys.push([10, 12, , 17]);
19893-
return [4 /*yield*/, processFunc(body_1, response)];
19898+
if (!processFunc) return [3 /*break*/, 18];
19899+
_a.label = 11;
1989419900
case 11:
19901+
_a.trys.push([11, 13, , 18]);
19902+
return [4 /*yield*/, processFunc(body_1, response)];
19903+
case 12:
1989519904
result = _a.sent();
1989619905
runningTimeout.cancel();
1989719906
return [2 /*return*/, result];
19898-
case 12:
19907+
case 13:
1989919908
error_2 = _a.sent();
19900-
if (!(error_2.throttleRetry && attempt < attemptLimit)) return [3 /*break*/, 16];
19909+
if (!(error_2.throttleRetry && attempt < attemptLimit)) return [3 /*break*/, 17];
1990119910
tryAgain = true;
19902-
if (!throttleCallback) return [3 /*break*/, 14];
19911+
if (!throttleCallback) return [3 /*break*/, 15];
1990319912
return [4 /*yield*/, throttleCallback(attempt, url)];
19904-
case 13:
19905-
tryAgain = _a.sent();
19906-
_a.label = 14;
1990719913
case 14:
19908-
if (!tryAgain) return [3 /*break*/, 16];
19914+
tryAgain = _a.sent();
19915+
_a.label = 15;
19916+
case 15:
19917+
if (!tryAgain) return [3 /*break*/, 17];
1990919918
timeout_1 = throttleSlotInterval * parseInt(String(Math.random() * Math.pow(2, attempt)));
1991019919
//console.log("Stalling callback");
1991119920
return [4 /*yield*/, staller(timeout_1)];
19912-
case 15:
19921+
case 16:
1991319922
//console.log("Stalling callback");
1991419923
_a.sent();
19915-
return [3 /*break*/, 18];
19916-
case 16:
19924+
return [3 /*break*/, 19];
19925+
case 17:
1991719926
runningTimeout.cancel();
1991819927
logger.throwError("processing response error", lib.Logger.errors.SERVER_ERROR, {
1991919928
body: bodyify(body_1, ((response.headers) ? response.headers["content-type"] : null)),
@@ -19922,16 +19931,16 @@
1992219931
requestMethod: options.method,
1992319932
url: url
1992419933
});
19925-
return [3 /*break*/, 17];
19926-
case 17:
19934+
return [3 /*break*/, 18];
19935+
case 18:
1992719936
runningTimeout.cancel();
1992819937
// If we had a processFunc, it either returned a T or threw above.
1992919938
// The "body" is now a Uint8Array.
1993019939
return [2 /*return*/, body_1];
19931-
case 18:
19940+
case 19:
1993219941
attempt++;
1993319942
return [3 /*break*/, 1];
19934-
case 19: return [2 /*return*/, logger.throwError("failed response", lib.Logger.errors.SERVER_ERROR, {
19943+
case 20: return [2 /*return*/, logger.throwError("failed response", lib.Logger.errors.SERVER_ERROR, {
1993519944
requestBody: bodyify(options.body, flatHeaders["content-type"]),
1993619945
requestMethod: options.method,
1993719946
url: url

packages/ethers/dist/ethers.umd.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ethers/dist/ethers.umd.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ethers/dist/ethers.umd.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)