Skip to content

object_store: Uploading empty file to S3 results in "411 Length Required" #155

Description

@Turbo87

Describe the bug

When using the S3 implementation of object_store a put() call with an empty content fails on the server side with a "411 Length Required" error:

Generic S3 error: response error "<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>MissingContentLength</Code><Message>You must provide the Content-Length HTTP header.</Message></Error>", after 0 retries: HTTP status client error (411 Length Required) for url (https://s3.us-west-2.amazonaws.com/...)

To Reproduce

s3_store.put(&"foo".into(), Bytes::new()).await.unwrap()

Expected behavior

The call succeeds and uploads an empty file to S3.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions