Skip to content

Commit 4037ae0

Browse files
committed
Check token value in uploadBundledDatabase
1 parent 92efd5c commit 4037ae0

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

‎lib/entry-points.js‎

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

‎src/database-upload.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ async function uploadBundledDatabase(
279279
uploadsBaseUrl = uploadsBaseUrl.slice(0, -1);
280280
}
281281

282+
const token = apiDetails.auth?.trim();
283+
const hasToken = token !== undefined && token !== "";
284+
const authorization = hasToken ? `token ${token}` : undefined;
285+
282286
const bundledDbReadStream = fs.createReadStream(bundledDb);
283287
try {
284288
const startTime = performance.now();
@@ -293,7 +297,7 @@ async function uploadBundledDatabase(
293297
commit_oid: commitOid,
294298
data: bundledDbReadStream,
295299
headers: {
296-
authorization: `token ${apiDetails.auth}`,
300+
authorization,
297301
"Content-Type": "application/zip",
298302
"Content-Length": bundledDbSize,
299303
},

0 commit comments

Comments
 (0)