Rename Result.Headers to Result.Header.
This way, it's consistent with http.Header in the response.
diff --git a/openstack/objectstorage/v1/objects/results.go b/openstack/objectstorage/v1/objects/results.go
index 45a1048..e662b69 100644
--- a/openstack/objectstorage/v1/objects/results.go
+++ b/openstack/objectstorage/v1/objects/results.go
@@ -64,7 +64,7 @@
// ExtractNames is a function that takes a page of objects and returns only their names.
func ExtractNames(page pagination.Page) ([]string, error) {
casted := page.(ObjectPage)
- ct := casted.Headers.Get("Content-Type")
+ ct := casted.Header.Get("Content-Type")
switch {
case strings.HasPrefix(ct, "application/json"):
parsed, err := ExtractInfo(page)
@@ -122,7 +122,7 @@
return nil, gr.Err
}
metadata := make(map[string]string)
- for k, v := range gr.Headers {
+ for k, v := range gr.Header {
if strings.HasPrefix(k, "X-Object-Meta-") {
key := strings.TrimPrefix(k, "X-Object-Meta-")
metadata[key] = v[0]
@@ -138,7 +138,7 @@
// Extract returns the unmodified HTTP response headers from a Create, Update, or Delete call, as
// well as any errors that occurred during the call.
func (result headerResult) Extract() (http.Header, error) {
- return result.Headers, result.Err
+ return result.Header, result.Err
}
// CreateResult represents the result of a create operation.