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 = {
userMetadata: require('./lib/s3middleware/userMetadata'),
convertToXml: require('./lib/s3middleware/convertToXml'),
escapeForXml: require('./lib/s3middleware/escapeForXml'),
convertToXml: require('./lib/s3middleware/convertToXml').default,
escapeForXml: require('./lib/s3middleware/escapeForXml').default,
objectLegalHold: require('./lib/s3middleware/objectLegalHold'),
tagging: require('./lib/s3middleware/tagging'),
checkDateModifiedHeaders:
@ -73,16 +73,16 @@ export const s3middleware = {
validateConditionalHeaders:
require('./lib/s3middleware/validateConditionalHeaders')
.validateConditionalHeaders,
MD5Sum: require('./lib/s3middleware/MD5Sum'),
NullStream: require('./lib/s3middleware/nullStream'),
MD5Sum: require('./lib/s3middleware/MD5Sum').default,
NullStream: require('./lib/s3middleware/nullStream').default,
objectUtils: require('./lib/s3middleware/objectUtils'),
azureHelper: {
mpuUtils:
require('./lib/s3middleware/azureHelpers/mpuUtils'),
ResultsCollector:
require('./lib/s3middleware/azureHelpers/ResultsCollector'),
require('./lib/s3middleware/azureHelpers/ResultsCollector').default,
SubStreamInterface:
require('./lib/s3middleware/azureHelpers/SubStreamInterface'),
require('./lib/s3middleware/azureHelpers/SubStreamInterface').default,
},
prepareStream: require('./lib/s3middleware/prepareStream'),
processMpuParts: require('./lib/s3middleware/processMpuParts'),

View File

@ -3,7 +3,7 @@ const UUID = require('uuid');
const errors = require('../errors').default;
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.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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