Skip to content

Lowercase object metadata keys before storing #9730

@zubron

Description

@zubron

lakeFS currently stores object metadata keys with title-case (e.g., Foo, MyKey), but S3 stores them in lowercase per the S3 specification:

Amazon S3 stores user-defined metadata keys in lowercase

Why this happens:
Go's HTTP library canonicalizes HTTP headers to title-case (e.g., X-Amz-Meta-Foo) which is correct HTTP behaviour. However, the metadata key (the part after x-amz-meta-) should be extracted and lowercased before storage, since it's data, not an HTTP header name.

Current behaviour:

HTTP Request: X-Amz-Meta-Foo: bar
lakeFS stores: Foo → bar          (title-cased)
S3 stores:     foo → bar          (lowercased)

Impact:

  • Client code expecting metadata['foo'] fails to find metadata['Foo']
  • Breaks S3 compatibility

Metadata

Metadata

Assignees

Labels

area/APIImprovements or additions to the APIarea/gatewayChanges to the gateway

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions