You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there! I was using the cloud storage API to upload an empty file to GCS and got the following error:
HTTP status client error (411 Length Required) for url (https://storage.googleapis.com/upload/storage/v1/b/bucket-name/o?uploadType=media&name=hello_world.txt)
I was able to get around it by explicitly setting the Media::content_length property to Some(0) when the data was empty.
I couldn't track it down in GCP docs, but is it known that the content-length header must be set (with a value of 0) if uploading an empty file? And if so, should this be implemented within the cloud-storage crate (i.e. at the library level)?
The text was updated successfully, but these errors were encountered:
Since the library for Golang is able to upload even 0 bytes without explicitly specifying content-length, we think it would be better to automatically set content-length: 0 inside the library.
After investigation, it seems that we can get the size of the body with zero-copy, so we will implement it.
Hi there! I was using the cloud storage API to upload an empty file to GCS and got the following error:
I was able to get around it by explicitly setting the
Media::content_length
property toSome(0)
when the data was empty.I couldn't track it down in GCP docs, but is it known that the content-length header must be set (with a value of 0) if uploading an empty file? And if so, should this be implemented within the cloud-storage crate (i.e. at the library level)?
The text was updated successfully, but these errors were encountered: