Skip to content

Commit

Permalink
fix: do not default on content-range
Browse files Browse the repository at this point in the history
  • Loading branch information
fenos committed Apr 17, 2024
1 parent a4a698d commit 79373f8
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/storage/protocols/s3/s3-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ export class S3ProtocolHandler {
throw ERRORS.MissingParameter('Bucket')
}

const object = await this.storage.from(Bucket).findObject(Key, '*')
const object = await this.storage.from(Bucket).findObject(Key, 'metadata,created_at,updated_at')

if (!object) {
throw ERRORS.NoSuchKey(Key)
Expand Down Expand Up @@ -822,7 +822,7 @@ export class S3ProtocolHandler {
const bucket = command.Bucket as string
const key = command.Key as string

const object = await this.storage.from(bucket).findObject(key, '*')
const object = await this.storage.from(bucket).findObject(key, 'version')
const response = await this.storage.backend.getObject(
storageS3Bucket,
`${this.tenantId}/${bucket}/${key}`,
Expand All @@ -837,7 +837,7 @@ export class S3ProtocolHandler {
headers: {
'cache-control': response.metadata.cacheControl,
'content-length': response.metadata.contentLength?.toString() || '0',
'content-range': response.metadata.contentRange?.toString() || '0',
'content-range': response.metadata.contentRange?.toString() || '',
'content-type': response.metadata.mimetype,
etag: response.metadata.eTag,
'last-modified': response.metadata.lastModified?.toUTCString() || '',
Expand Down Expand Up @@ -966,15 +966,9 @@ export class S3ProtocolHandler {
throw ERRORS.MissingParameter('CopySource')
}

const object = await this.storage.from(sourceBucket).findObject(sourceKey, '*')

if (!object) {
throw ERRORS.NoSuchKey(sourceKey)
}

const copyResult = await this.storage
.from(sourceBucket)
.copyObject(sourceKey, Bucket, Key, object.owner, {
.copyObject(sourceKey, Bucket, Key, this.owner, {
ifMatch: command.CopySourceIfMatch,
ifNoneMatch: command.CopySourceIfNoneMatch,
ifModifiedSince: command.CopySourceIfModifiedSince,
Expand Down

0 comments on commit 79373f8

Please sign in to comment.