Set the Content-Type or OmitContentType option.
diff --git a/openstack/objectstorage/v1/objects/requests.go b/openstack/objectstorage/v1/objects/requests.go
index 7b96fa2..0fdb041 100644
--- a/openstack/objectstorage/v1/objects/requests.go
+++ b/openstack/objectstorage/v1/objects/requests.go
@@ -205,14 +205,20 @@
url += query
}
- contentType := h["Content-Type"]
-
- resp, err := perigee.Request("PUT", url, perigee.Options{
- ContentType: contentType,
+ popts := perigee.Options{
ReqBody: content,
MoreHeaders: h,
OkCodes: []int{201, 202},
- })
+ }
+
+ if contentType, explicit := h["Content-Type"]; explicit {
+ popts.ContentType = contentType
+ delete(h, "Content-Type")
+ } else {
+ popts.OmitContentType = true
+ }
+
+ resp, err := perigee.Request("PUT", url, popts)
res.Header = resp.HttpResponse.Header
res.Err = err
return res