Bug Description
parse_multipart in testbench/common.py (line 307) crashes with a KeyError when a multipart upload body part does not include a Content-Type header.
Steps to Reproduce
Send a multipart upload request where the media body part omits the Content-Type header. This is what the google-cloud-storage Rust crate does when calling write_object(...).send_buffered().
Error
File "/opt/storage-testbench/testbench/common.py", line 307, in parse_multipart
content_type = {"content-type": headers[content_type_key].decode("utf-8")}
~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: b'content-type'
Expected Behavior
Per RFC 2046, a missing Content-Type in a body part should default to text/plain (or application/octet-stream for GCS media). The testbench should handle this gracefully rather than crashing.
The real GCS API accepts these uploads without issue.
Environment
- storage-testbench Docker image:
gcr.io/cloud-devrel-public-resources/storage-testbench:latest (pulled 2026-05-15)
- Client:
google-cloud-storage Rust crate (google-cloud-rust)
Bug Description
parse_multipartintestbench/common.py(line 307) crashes with aKeyErrorwhen a multipart upload body part does not include aContent-Typeheader.Steps to Reproduce
Send a multipart upload request where the media body part omits the
Content-Typeheader. This is what thegoogle-cloud-storageRust crate does when callingwrite_object(...).send_buffered().Error
Expected Behavior
Per RFC 2046, a missing
Content-Typein a body part should default totext/plain(orapplication/octet-streamfor GCS media). The testbench should handle this gracefully rather than crashing.The real GCS API accepts these uploads without issue.
Environment
gcr.io/cloud-devrel-public-resources/storage-testbench:latest(pulled 2026-05-15)google-cloud-storageRust crate (google-cloud-rust)