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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "badgr-cli",
3
- "version": "1.0.47",
3
+ "version": "1.0.48",
4
4
  "description": "Badgr — run or serve GPU workloads from one command",
5
5
  "type": "module",
6
6
  "bin": {
@@ -141,7 +141,15 @@ async function downloadAndExtractArtifacts(config, runId) {
141
141
  const destDir = artifactsDir(runId);
142
142
  mkdirSync(destDir, { recursive: true });
143
143
 
144
- const res = await fetch(meta.download_url, {
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) {