Skip to content

InstructionFile file size wrong for very small files if you set the contentLength #494

@janSchumacherPayments

Description

@janSchumacherPayments

Problem:

  1. Enabling InstructionFileConfiguration
  2. Uploading a file of just some few bytes (i.e. 24 bytes)
  3. Set the contentLength in the original upload PutObjectRequest
    PutObjectRequest putObjectRequest = PutObjectRequest.builder().bucket(bucket).contentLength((long) content.length).key(objectKey).build();
  4. The checksum validation fails - The PutObjectRequest for the instruction file is created from the original PutObjectRequest as a foundation. Bug - The contentLength of the original request has been set to the instruction file PutObjectRequest to 24 bytes until the point of upload. - the uploaded instruction files content looks like this {"x-amz-tag-len":"128"," (Uploaded with disabled checksum validation)

Solution:

Reset the contentLength of the InstructionFiles PutObjectRequest to null or the calculated InstructionFile length.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions