Compare commits

...

1 Commits

Author SHA1 Message Date
Hervé Dombya 0ab6b138c2 try some fix 2023-11-30 17:12:31 +01:00
4 changed files with 7 additions and 7 deletions

View File

@ -18,7 +18,7 @@ function getVeeamFile(request, response, bucketMd, log) {
return responseXMLBody(errors.NoSuchBucket, null, response, log); return responseXMLBody(errors.NoSuchBucket, null, response, log);
} }
if ('tagging' in request.query) { if ('tagging' in request.query) {
return respondWithData(request, response, log, request.bucketName, return respondWithData(request, response, log, bucketMd,
buildHeadXML('<Tagging><TagSet></TagSet></Tagging>')); buildHeadXML('<Tagging><TagSet></TagSet></Tagging>'));
} }
return metadata.getBucket(request.bucketName, log, (err, data) => { return metadata.getBucket(request.bucketName, log, (err, data) => {
@ -38,7 +38,7 @@ function getVeeamFile(request, response, bucketMd, log) {
const builder = new xml2js.Builder({ const builder = new xml2js.Builder({
headless: true, headless: true,
}); });
return respondWithData(request, response, log, request.bucketName, return respondWithData(request, response, log, data,
buildHeadXML(builder.buildObject(fileToBuild.value)), modified); buildHeadXML(builder.buildObject(fileToBuild.value)), modified);
}); });
} }

View File

@ -35,7 +35,7 @@ function headVeeamFile(request, response, bucketMd, log) {
headless: true, headless: true,
}); });
const dataBuffer = Buffer.from(buildHeadXML(builder.buildObject(fileToBuild))); const dataBuffer = Buffer.from(buildHeadXML(builder.buildObject(fileToBuild)));
return responseContentHeaders(null, {}, getResponseHeader(request, request.bucketName, return responseContentHeaders(null, {}, getResponseHeader(request, data,
dataBuffer, modified, log), response, log); dataBuffer, modified, log), response, log);
}); });
} }

View File

@ -118,13 +118,13 @@ function listVeeamFiles(request, response, bucketMd, log) {
}); });
const dataBuffer = Buffer.from(buildHeadXML(builder.buildObject(file))); const dataBuffer = Buffer.from(buildHeadXML(builder.buildObject(file)));
filesToBuild.push({ filesToBuild.push({
...getResponseHeader(request, request.bucketName, ...getResponseHeader(request, data,
dataBuffer, lastModified, log), dataBuffer, lastModified, log),
name: file.name, name: file.name,
}); });
}); });
// When `versions` is present, listing should return a versioned list // When `versions` is present, listing should return a versioned list
return respondWithData(request, response, log, request.bucketName, return respondWithData(request, response, log, data,
buildXMLResponse(request, filesToBuild, 'versions' in request.query)); buildXMLResponse(request, filesToBuild, 'versions' in request.query));
}); });
} }

View File

@ -72,7 +72,7 @@ function buildHeadXML(xmlContent) {
/** /**
* Get response headers for the object * Get response headers for the object
* @param {object} request - incoming request * @param {object} request - incoming request
* @param {string} bucket - bucket name * @param {BucketInfo} bucket - bucket
* @param {string} dataBuffer - data to send as a buffer * @param {string} dataBuffer - data to send as a buffer
* @param {date} [lastModified] - last modified date of the value * @param {date} [lastModified] - last modified date of the value
* @param {object} log - logging object * @param {object} log - logging object
@ -101,7 +101,7 @@ function getResponseHeader(request, bucket, dataBuffer, lastModified, log) {
* @param {object} request - incoming request * @param {object} request - incoming request
* @param {object} response - response object * @param {object} response - response object
* @param {object} log - logging object * @param {object} log - logging object
* @param {string} bucket - bucket name * @param {BucketInfo} bucket - bucket info
* @param {string} data - data to send * @param {string} data - data to send
* @param {date} [lastModified] - last modified date of the value * @param {date} [lastModified] - last modified date of the value
* @returns {undefined} - * @returns {undefined} -