Skip to content

S3: GetObjectRequest: Support for If-Range header #1645

@berlix

Description

@berlix

Describe the bug

This is somewhere between a bug report and a feature request, as it seems to be a strange omission.

It appears that S3 handles the If-Range header correctly when responding to GetObject requests. However, aws.sdk.kotlin.services.s3.model.GetObjectRequest does not support setting it (it does support setting Range and If-Match).

Background: If-Range is similar to If-Match, except that it in case the ETag does not match, the entire object is returned rather than status 412.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected behavior

Ability to set If-Range header in aws.sdk.kotlin.services.s3.model.GetObjectRequest.

Current behavior

No such facility exists in aws.sdk.kotlin.services.s3.model.GetObjectRequest.

Steps to Reproduce

  1. Search for the strings If-Range and ifRange in aws.sdk.kotlin.services.s3.model.GetObjectRequest.
  2. Find none.

Possible Solution

No response

Context

I have a backend component that proxies some requests to S3. The clients of my backend component use If-Range for partial downloads. It would be convenient to be able to just forward those headers to S3.

My current workaround is to translate client requests with If-Range into multiple GetObjectRequests:

  • One with If-Match and Range.
  • In case that first request returns status 412, a second request without Range and If-Match.

AWS SDK for Kotlin version

1.4.119

Platform (JVM/JS/Native)

JVM

Operating system and version

Ubuntu 25.04

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.service-apiThis issue is due to a problem in a service API, not the SDK implementation.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions