Compare commits

...

9 Commits

Author SHA1 Message Date
williamlardier cb03323c13
ARSN-193: fix wrong condition 2022-05-09 13:48:54 +02:00
williamlardier 21828e6fe7
ARSN-193: fix identation 2022-05-09 11:37:36 +02:00
williamlardier df6c58df6e
ARSN-193: fix bug 2022-05-09 11:33:47 +02:00
williamlardier 4af9eef84a
ARSN-193: fix more imports 5 2022-05-09 11:15:58 +02:00
williamlardier 99130fe093
ARSN-193: fix more imports 4 2022-05-09 11:10:06 +02:00
williamlardier 41d21d61d9
ARSN-193: fix more imports 3 2022-05-09 11:03:24 +02:00
williamlardier 4d7ab6411c
ARSN-193: fix more imports 2 2022-05-09 11:02:05 +02:00
williamlardier af38e8f7af
ARSN-193: fix more imports 2022-05-09 10:58:12 +02:00
williamlardier 087c1710bf
ARSN-193: fix MD5Sum imports 2022-05-09 10:39:12 +02:00
9 changed files with 16 additions and 18 deletions

View File

@ -63,8 +63,8 @@ export const s3routes = {
export const s3middleware = { export const s3middleware = {
userMetadata: require('./lib/s3middleware/userMetadata'), userMetadata: require('./lib/s3middleware/userMetadata'),
convertToXml: require('./lib/s3middleware/convertToXml'), convertToXml: require('./lib/s3middleware/convertToXml').default,
escapeForXml: require('./lib/s3middleware/escapeForXml'), escapeForXml: require('./lib/s3middleware/escapeForXml').default,
objectLegalHold: require('./lib/s3middleware/objectLegalHold'), objectLegalHold: require('./lib/s3middleware/objectLegalHold'),
tagging: require('./lib/s3middleware/tagging'), tagging: require('./lib/s3middleware/tagging'),
checkDateModifiedHeaders: checkDateModifiedHeaders:
@ -73,16 +73,16 @@ export const s3middleware = {
validateConditionalHeaders: validateConditionalHeaders:
require('./lib/s3middleware/validateConditionalHeaders') require('./lib/s3middleware/validateConditionalHeaders')
.validateConditionalHeaders, .validateConditionalHeaders,
MD5Sum: require('./lib/s3middleware/MD5Sum'), MD5Sum: require('./lib/s3middleware/MD5Sum').default,
NullStream: require('./lib/s3middleware/nullStream'), NullStream: require('./lib/s3middleware/nullStream').default,
objectUtils: require('./lib/s3middleware/objectUtils'), objectUtils: require('./lib/s3middleware/objectUtils'),
azureHelper: { azureHelper: {
mpuUtils: mpuUtils:
require('./lib/s3middleware/azureHelpers/mpuUtils'), require('./lib/s3middleware/azureHelpers/mpuUtils'),
ResultsCollector: ResultsCollector:
require('./lib/s3middleware/azureHelpers/ResultsCollector'), require('./lib/s3middleware/azureHelpers/ResultsCollector').default,
SubStreamInterface: SubStreamInterface:
require('./lib/s3middleware/azureHelpers/SubStreamInterface'), require('./lib/s3middleware/azureHelpers/SubStreamInterface').default,
}, },
prepareStream: require('./lib/s3middleware/prepareStream'), prepareStream: require('./lib/s3middleware/prepareStream'),
processMpuParts: require('./lib/s3middleware/processMpuParts'), processMpuParts: require('./lib/s3middleware/processMpuParts'),

View File

@ -3,7 +3,7 @@ const UUID = require('uuid');
const errors = require('../errors').default; const errors = require('../errors').default;
const LifecycleRule = require('./LifecycleRule'); const LifecycleRule = require('./LifecycleRule');
const escapeForXml = require('../s3middleware/escapeForXml'); const escapeForXml = require('../s3middleware/escapeForXml').default;
const MAX_DAYS = 2147483647; // Max 32-bit signed binary integer. const MAX_DAYS = 2147483647; // Max 32-bit signed binary integer.

View File

@ -1,7 +1,7 @@
const assert = require('assert'); const assert = require('assert');
const UUID = require('uuid'); const UUID = require('uuid');
const escapeForXml = require('../s3middleware/escapeForXml'); const escapeForXml = require('../s3middleware/escapeForXml').default;
const errors = require('../errors').default; const errors = require('../errors').default;
const { isValidBucketName } = require('../s3routes/routesUtils'); const { isValidBucketName } = require('../s3routes/routesUtils');

View File

@ -94,9 +94,7 @@ export const listMultipartUploads = (xmlParams: ListParams) => {
params.forEach(param => { params.forEach(param => {
if (param.value) { if (param.value) {
xml.push( xml.push(
`<${param.tag}> `<${param.tag}>${escapeForXml(param.value)}</${param.tag}>`
${escapeForXml(param.value)}
</${param.tag}>`
); );
} else if (!param.optional) { } else if (!param.optional) {
xml.push(`<${param.tag} />`); xml.push(`<${param.tag} />`);
@ -123,7 +121,7 @@ export const listMultipartUploads = (xmlParams: ListParams) => {
`<ID>${escapeForXml(val.Initiator.ID)}</ID>`, `<ID>${escapeForXml(val.Initiator.ID)}</ID>`,
`<DisplayName>`, `<DisplayName>`,
escapeForXml(val.Initiator.DisplayName), escapeForXml(val.Initiator.DisplayName),
'/DisplayName>', '</DisplayName>',
'</Initiator>', '</Initiator>',
'<Owner>', '<Owner>',
`<ID>${escapeForXml(val.Owner.ID)}</ID>`, `<ID>${escapeForXml(val.Owner.ID)}</ID>`,

View File

@ -14,7 +14,7 @@ export function getMetaHeaders(headers: http.IncomingHttpHeaders) {
if (!v) return length; if (!v) return length;
return length + k.length + v.toString().length; return length + k.length + v.toString().length;
}, 0); }, 0);
if (totalLength < constants.maximumMetaHeadersSize) { if (totalLength <= constants.maximumMetaHeadersSize) {
return Object.fromEntries(filtered); return Object.fromEntries(filtered);
} else { } else {
return errors.MetadataTooLarge; return errors.MetadataTooLarge;

View File

@ -3,8 +3,8 @@ const PassThrough = require('stream').PassThrough;
const assert = require('assert'); const assert = require('assert');
const errors = require('../../errors').default; const errors = require('../../errors').default;
const MD5Sum = require('../../s3middleware/MD5Sum'); const MD5Sum = require('../../s3middleware/MD5Sum').default;
const NullStream = require('../../s3middleware/nullStream'); const NullStream = require('../../s3middleware/nullStream').default;
const RelayMD5Sum = require('./utils/RelayMD5Sum'); const RelayMD5Sum = require('./utils/RelayMD5Sum');
const backendUtils = require('./external/utils'); const backendUtils = require('./external/utils');
const constants = require('../../constants'); const constants = require('../../constants');

View File

@ -2,7 +2,7 @@ const AWS = require('aws-sdk');
const werelogs = require('werelogs'); const werelogs = require('werelogs');
const errors = require('../../../errors').default; const errors = require('../../../errors').default;
const MD5Sum = require('../../../s3middleware/MD5Sum'); const MD5Sum = require('../../../s3middleware/MD5Sum').default;
const getMetaHeaders = const getMetaHeaders =
require('../../../s3middleware/userMetadata').getMetaHeaders; require('../../../s3middleware/userMetadata').getMetaHeaders;
const { prepareStream } = require('../../../s3middleware/prepareStream'); const { prepareStream } = require('../../../s3middleware/prepareStream');

View File

@ -2,7 +2,7 @@ const url = require('url');
const azure = require('azure-storage'); const azure = require('azure-storage');
const errors = require('../../../errors').default; const errors = require('../../../errors').default;
const azureMpuUtils = require('../../../s3middleware/azureHelpers/mpuUtils'); const azureMpuUtils = require('../../../s3middleware/azureHelpers/mpuUtils').default;
const { validateAndFilterMpuParts } = const { validateAndFilterMpuParts } =
require('../../../s3middleware/processMpuParts'); require('../../../s3middleware/processMpuParts');

View File

@ -1,7 +1,7 @@
const async = require('async'); const async = require('async');
const errors = require('../../../errors').default; const errors = require('../../../errors').default;
const MD5Sum = require('../../../s3middleware/MD5Sum'); const MD5Sum = require('../../../s3middleware/MD5Sum').default;
const { GCP, GcpUtils } = require('./GCP'); const { GCP, GcpUtils } = require('./GCP');
const { createMpuKey } = GcpUtils; const { createMpuKey } = GcpUtils;
const AwsClient = require('./AwsClient'); const AwsClient = require('./AwsClient');