Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not default on content-range #456

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading