Check token value in uploadBundledDatabase

This commit is contained in:
Michael B. Gale
2026-10-14 11:21:44 +01:00
parent d6f4244c4b
commit f4d1fd4519
2 changed files with 9 additions and 2 deletions

5
lib/entry-points.js generated
View File

@@ -178468,6 +178468,9 @@ async function uploadBundledDatabase(repositoryNwo, language, commitOid, bundled
if (uploadsBaseUrl.endsWith("/")) {
uploadsBaseUrl = uploadsBaseUrl.slice(0, -1);
}
const token = apiDetails.auth?.trim();
const hasToken2 = token !== void 0 && token !== "";
const authorization = hasToken2 ? `token ${token}` : void 0;
const bundledDbReadStream = fs18.createReadStream(bundledDb);
try {
const startTime = performance.now();
@@ -178482,7 +178485,7 @@ async function uploadBundledDatabase(repositoryNwo, language, commitOid, bundled
commit_oid: commitOid,
data: bundledDbReadStream,
headers: {
authorization: `token ${apiDetails.auth}`,
authorization,
"Content-Type": "application/zip",
"Content-Length": bundledDbSize
},

View File

@@ -279,6 +279,10 @@ async function uploadBundledDatabase(
uploadsBaseUrl = uploadsBaseUrl.slice(0, -1);
}
const token = apiDetails.auth?.trim();
const hasToken = token !== undefined && token !== "";
const authorization = hasToken ? `token ${token}` : undefined;
const bundledDbReadStream = fs.createReadStream(bundledDb);
try {
const startTime = performance.now();
@@ -293,7 +297,7 @@ async function uploadBundledDatabase(
commit_oid: commitOid,
data: bundledDbReadStream,
headers: {
authorization: `token ${apiDetails.auth}`,
authorization,
"Content-Type": "application/zip",
"Content-Length": bundledDbSize,
},