Skip to content

Storage: read_object fails when object content-encoding is gzip #3511

@renato145

Description

@renato145

Environment details

  • Programming language: rust
  • OS: ubuntu 22.04
  • Language runtime version: 1.90
  • Package version: 1.1.0

Steps to reproduce

  1. Following the example code to download an object:
storage
        .read_object("projects/_/buckets/xxx", "some-file.tar.gz")
        .send()
        .await;

I get the following error when the file have "gzip" as the Content-Encoding value in its metadata:

cannot deserialize the response the response is missing 'content-length', a required header
--------------------
Error {
    kind: Deserialization,
    source: Some(
        MissingHeader(
            "content-length",
        ),
    ),
}

When Content-Encoding is not present, there is no error. I tested by editing the metadata in https://console.cloud.google.com/storage/browser/

Image

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the Cloud Storage API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions