Add user agent and log urls on the sync-assets script

This commit is contained in:
Felipe Knorr Kuhn 2026-07-02 02:04:41 +09:00
parent 6314bc1f54
commit 3b192f6ff5
No known key found for this signature in database
GPG key ID: 79619B52BB097C1A

View file

@ -80,9 +80,9 @@ const downloadFile = (filePath, url) => {
}
return new Promise((resolve, reject) => {
https.get(url, (response) => {
https.get(url, { headers: { 'user-agent': 'node.js' } }, (response) => {
if (response.statusCode < 200 || response.statusCode > 299) {
reject(new Error(`HTTP Error ${response.statusCode} while fetching '${filePath}'`));
reject(new Error(`HTTP Error ${response.statusCode} while fetching '${url}' (destination '${filePath}')`));
return;
}