badgr-cli 1.0.47 → 1.0.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/batch.js +9 -1
package/package.json
CHANGED
package/src/commands/batch.js
CHANGED
|
@@ -141,7 +141,15 @@ async function downloadAndExtractArtifacts(config, runId) {
|
|
|
141
141
|
const destDir = artifactsDir(runId);
|
|
142
142
|
mkdirSync(destDir, { recursive: true });
|
|
143
143
|
|
|
144
|
-
|
|
144
|
+
// Prefer the CLI's configured HTTPS base URL over meta.download_url.
|
|
145
|
+
// Behind the gateway, request.base_url is often http://…, and fetch() following
|
|
146
|
+
// the http→https redirect drops the Authorization header → 401.
|
|
147
|
+
const base = String(config.baseUrl || '').replace(/\/$/, '');
|
|
148
|
+
const downloadUrl = base
|
|
149
|
+
? `${base}/deployments/${runId}/artifacts/download`
|
|
150
|
+
: meta.download_url;
|
|
151
|
+
|
|
152
|
+
const res = await fetch(downloadUrl, {
|
|
145
153
|
headers: { Authorization: `Bearer ${config.apiKey}` },
|
|
146
154
|
});
|
|
147
155
|
if (!res.ok) {
|