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
As far as I can see in the fake-gcs-server code, contentType is only set when the object is created, and can't be updated.
I'm using the official python gcs library, basically as follows:
# initfromgoogle.cloudimportstorageclient=BigMessyConnectionToFakeGcsServer(storage.Client)
bucket=client.bucket("my-test-bucket")
key="test-key"# upload some datablob=bucket.blob(key)
blob.upload_from_string(b"some data", content_type="application/octet-stream")
# now fix the content typeblob=bucket.get_blob(key)
blob.content_type="text/plain"blob.patch()
The content-type value returned from the API request (buried in google's patch() method definition) is the original unchanged application/octet-stream, as is the content-type when trying to download the blob.
Debugging into google's code, this is sending {"contentType": "application/some-new-type"} along with the API request as the body content, which seems to be completely ignored by Server.patchObject unmarshaling into its metadata struct.
The text was updated successfully, but these errors were encountered:
FWIW I think I just ran into this same issue. Wrote the integration test for our feature that updates an object's content-type, and was confused about what I was doing wrong with what I though was a very simple implementation 😅
As far as I can see in the fake-gcs-server code, contentType is only set when the object is created, and can't be updated.
I'm using the official python gcs library, basically as follows:
The content-type value returned from the API request (buried in google's
patch()
method definition) is the original unchangedapplication/octet-stream
, as is the content-type when trying to download the blob.Debugging into google's code, this is sending
{"contentType": "application/some-new-type"}
along with the API request as the body content, which seems to be completely ignored byServer.patchObject
unmarshaling into itsmetadata
struct.The text was updated successfully, but these errors were encountered: