ThouCheese / cloud-storage-rs

A crate for uploading files to Google cloud storage, and for generating download urls.
MIT License
123 stars 88 forks source link

BucketClient::list Returns Error on successful response #115

Closed junbl closed 2 years ago

junbl commented 2 years ago

BucketClient::list appears to always return an error:

[src/main.rs:6] client.bucket().list().await = Err(
    Reqwest(
        reqwest::Error {
            kind: Decode,
            source: Error("data did not match any variant of untagged enum GoogleResponse", line: 0, column: 0),
        },
    ),
)

It also seems to have some dbg!()s left in--it runs the query twice just to debug print it (which is how we can see that the response successfully gets the buckets).

junbl commented 2 years ago

Looks like this is because I've got a bucket with a cors that includes only the method and origin fields, for whatever reason. This can be fixed by changing the max_age_seconds field on Cors to an Option<i32> and adding the #[serde(default)] annotation on all fields.

ThouCheese commented 2 years ago

Merged! Thanks a lot!