add 'ExtractHeader' method to object storage return types
diff --git a/openstack/objectstorage/v1/objects/requests.go b/openstack/objectstorage/v1/objects/requests.go
index f5ca296..56004b2 100644
--- a/openstack/objectstorage/v1/objects/requests.go
+++ b/openstack/objectstorage/v1/objects/requests.go
@@ -303,11 +303,12 @@
url += query
}
- _, res.Err = perigee.Request("DELETE", url, perigee.Options{
+ resp, err := perigee.Request("DELETE", url, perigee.Options{
MoreHeaders: c.AuthenticatedHeaders(),
OkCodes: []int{204},
})
-
+ res.Header = resp.HttpResponse.Header
+ res.Err = err
return res
}
diff --git a/openstack/objectstorage/v1/objects/results.go b/openstack/objectstorage/v1/objects/results.go
index 97a6f91..7524c43 100644
--- a/openstack/objectstorage/v1/objects/results.go
+++ b/openstack/objectstorage/v1/objects/results.go
@@ -4,6 +4,7 @@
"fmt"
"io"
"io/ioutil"
+ "net/http"
"strings"
"github.com/rackspace/gophercloud"
@@ -97,13 +98,17 @@
}
}
-type commonResult struct {
+type headerResult struct {
gophercloud.Result
}
+func (hr headerResult) ExtractHeader() (http.Header, error) {
+ return hr.Header, hr.Err
+}
+
// DownloadResult is a *http.Response that is returned from a call to the Download function.
type DownloadResult struct {
- commonResult
+ headerResult
Body io.Reader
}
@@ -125,7 +130,7 @@
// GetResult is a *http.Response that is returned from a call to the Get function.
type GetResult struct {
- commonResult
+ headerResult
}
// ExtractMetadata is a function that takes a GetResult (of type *http.Response)
@@ -146,20 +151,20 @@
// CreateResult represents the result of a create operation.
type CreateResult struct {
- commonResult
+ headerResult
}
// UpdateResult represents the result of an update operation.
type UpdateResult struct {
- commonResult
+ headerResult
}
// DeleteResult represents the result of a delete operation.
type DeleteResult struct {
- gophercloud.ExtractErrResult
+ headerResult
}
// CopyResult represents the result of a copy operation.
type CopyResult struct {
- commonResult
+ headerResult
}