avancement planning

This commit is contained in:
2026-05-26 11:58:39 +02:00
parent 619a2b240a
commit 150b97cd2e
4892 changed files with 99214 additions and 429382 deletions
+6
View File
@@ -11,6 +11,7 @@ const util_1 = __importDefault(require("util"));
const error_1 = require("./error");
const tmpfile_1 = require("./utils/tmpfile");
const log = (0, debug_1.default)('tuf:fetch');
const USER_AGENT_HEADER = 'User-Agent';
class BaseFetcher {
// Download file from given URL. The file is downloaded to a temporary
// location and then passed to the given handler. The handler is responsible
@@ -54,16 +55,21 @@ class BaseFetcher {
}
exports.BaseFetcher = BaseFetcher;
class DefaultFetcher extends BaseFetcher {
userAgent;
timeout;
retry;
constructor(options = {}) {
super();
this.userAgent = options.userAgent;
this.timeout = options.timeout;
this.retry = options.retry;
}
async fetch(url) {
log('GET %s', url);
const response = await (0, make_fetch_happen_1.default)(url, {
headers: {
[USER_AGENT_HEADER]: this.userAgent || '',
},
timeout: this.timeout,
retry: this.retry,
});