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

Content-Disposition support is missing #1163

Closed
petrov-aleksey opened this issue Jun 13, 2023 · 2 comments
Closed

Content-Disposition support is missing #1163

petrov-aleksey opened this issue Jun 13, 2023 · 2 comments
Assignees
Labels

Comments

@petrov-aleksey
Copy link

Hi,

it seems that Content-Disposition is missing between put and get object.

Test to reproduce

@Test
fun testPutGetObject_contentDisposition(testInfo: TestInfo) {
  val bucket = givenRandomBucketV2()
  val uploadFile = File(UPLOAD_FILE_NAME)
  val contentDisposition = ContentDisposition.formData()
    .name("file")
    .filename("sampleFile.txt")
    .build()
    .toString()

  s3ClientV2.putObject(
    PutObjectRequest.builder()
      .bucket(bucket)
      .key(UPLOAD_FILE_NAME)
      .contentDisposition(contentDisposition)
      .build(),
    RequestBody.fromFile(uploadFile))

  val getObjectResponseResponse = getObjectV2(bucket, UPLOAD_FILE_NAME)

  assertThat(getObjectResponseResponse.response().contentDisposition())
    .isEqualTo(contentDisposition)
}

outputs

org.opentest4j.AssertionFailedError: 
expected: "form-data; name="file"; filename="sampleFile.txt""
 but was: null
@afranken afranken self-assigned this Jun 13, 2023
@afranken
Copy link
Member

@petrov-aleksey thanks for the report and the test.
Looking at our code and the Get/PutObject API, it seems that Content-Disposition isn't the only header we currently do not support...
Expires, Content-Language and Cache-Control are currently also ignored.

I'll look into supporting these headers.

@afranken
Copy link
Member

merged feature #1177

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants