Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
benzekrimaha committed Nov 28, 2024
1 parent 54fc5f0 commit 09dfc1b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/s3routes/routesUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ export const XMLResponseBackend = {
*/
const xml: string[] = [];
xml.push(
`<?xml version="1.0" encoding="UTF-8"?>`,
`<Error>`,
'<?xml version="1.0" encoding="UTF-8"?>',
'<Error>',
`<Code>${error.message}</Code>`,
`<Message>${error.description}</Message>`,
);
Expand All @@ -158,15 +158,13 @@ export const XMLResponseBackend = {
xml.push(`<ArgumentValue${counter}>${ArgumentValue}</ArgumentValue${counter}>`);
});
xml.push(
`<Resource></Resource>`,
'<Resource></Resource>',
`<RequestId>${log.getSerializedUids()}</RequestId>`,
`</Error>`,
'</Error>',
);
const xmlStr = xml.join('');
console.log(xmlStr);
const bytesSent = Buffer.byteLength(xmlStr);
log.addDefaultFields({ bytesSent });
console.log(bytesSent);
response.writeHead(error.code, {
'Content-Type': 'application/xml',
'Content-Length': bytesSent ,
Expand Down

0 comments on commit 09dfc1b

Please sign in to comment.