Rename Result.Headers to Result.Header.
This way, it's consistent with http.Header in the response.
diff --git a/openstack/objectstorage/v1/accounts/requests.go b/openstack/objectstorage/v1/accounts/requests.go
index 2706197..a364bcc 100644
--- a/openstack/objectstorage/v1/accounts/requests.go
+++ b/openstack/objectstorage/v1/accounts/requests.go
@@ -46,7 +46,7 @@
MoreHeaders: h,
OkCodes: []int{204},
})
- res.Headers = resp.HttpResponse.Header
+ res.Header = resp.HttpResponse.Header
res.Err = err
return res
}
@@ -100,7 +100,7 @@
MoreHeaders: h,
OkCodes: []int{204},
})
- res.Headers = resp.HttpResponse.Header
+ res.Header = resp.HttpResponse.Header
res.Err = err
return res
}
diff --git a/openstack/objectstorage/v1/accounts/results.go b/openstack/objectstorage/v1/accounts/results.go
index 964a604..e42577a 100644
--- a/openstack/objectstorage/v1/accounts/results.go
+++ b/openstack/objectstorage/v1/accounts/results.go
@@ -20,7 +20,7 @@
}
metadata := make(map[string]string)
- for k, v := range gr.Headers {
+ for k, v := range gr.Header {
if strings.HasPrefix(k, "X-Account-Meta-") {
key := strings.TrimPrefix(k, "X-Account-Meta-")
metadata[key] = v[0]
@@ -37,5 +37,5 @@
// Extract returns the unmodified HTTP headers and any error conditions encountered during the
// metadata update.
func (ur UpdateResult) Extract() (http.Header, error) {
- return ur.Headers, ur.Err
+ return ur.Header, ur.Err
}
diff --git a/openstack/objectstorage/v1/containers/requests.go b/openstack/objectstorage/v1/containers/requests.go
index 50542f4..25b68fd 100644
--- a/openstack/objectstorage/v1/containers/requests.go
+++ b/openstack/objectstorage/v1/containers/requests.go
@@ -115,7 +115,7 @@
MoreHeaders: h,
OkCodes: []int{201, 204},
})
- res.Headers = resp.HttpResponse.Header
+ res.Header = resp.HttpResponse.Header
res.Err = err
return res
}
@@ -127,7 +127,7 @@
MoreHeaders: c.Provider.AuthenticatedHeaders(),
OkCodes: []int{204},
})
- res.Headers = resp.HttpResponse.Header
+ res.Header = resp.HttpResponse.Header
res.Err = err
return res
}
@@ -186,7 +186,7 @@
MoreHeaders: h,
OkCodes: []int{204},
})
- res.Headers = resp.HttpResponse.Header
+ res.Header = resp.HttpResponse.Header
res.Err = err
return res
}
@@ -200,7 +200,7 @@
MoreHeaders: c.Provider.AuthenticatedHeaders(),
OkCodes: []int{204},
})
- res.Headers = resp.HttpResponse.Header
+ res.Header = resp.HttpResponse.Header
res.Err = err
return res
}
diff --git a/openstack/objectstorage/v1/containers/results.go b/openstack/objectstorage/v1/containers/results.go
index ec3c1e0..780d4ae 100644
--- a/openstack/objectstorage/v1/containers/results.go
+++ b/openstack/objectstorage/v1/containers/results.go
@@ -67,7 +67,7 @@
// ExtractNames is a function that takes a ListResult and returns the containers' names.
func ExtractNames(page pagination.Page) ([]string, error) {
casted := page.(ContainerPage)
- ct := casted.Headers.Get("Content-Type")
+ ct := casted.Header.Get("Content-Type")
switch {
case strings.HasPrefix(ct, "application/json"):
@@ -109,7 +109,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-Container-Meta-") {
key := strings.TrimPrefix(k, "X-Container-Meta-")
metadata[key] = v[0]
@@ -124,7 +124,7 @@
// Extract pulls the unmodified headers from a Create, Update, or Delete result.
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. To extract the
diff --git a/openstack/objectstorage/v1/objects/requests.go b/openstack/objectstorage/v1/objects/requests.go
index 49dc9f5..13d94f8 100644
--- a/openstack/objectstorage/v1/objects/requests.go
+++ b/openstack/objectstorage/v1/objects/requests.go
@@ -133,7 +133,7 @@
body, err := ioutil.ReadAll(resp.HttpResponse.Body)
res.Body = body
res.Err = err
- res.Headers = resp.HttpResponse.Header
+ res.Header = resp.HttpResponse.Header
return res
}
@@ -218,7 +218,7 @@
MoreHeaders: h,
OkCodes: []int{201},
})
- res.Headers = resp.HttpResponse.Header
+ res.Header = resp.HttpResponse.Header
res.Err = err
return res
}
@@ -274,7 +274,7 @@
MoreHeaders: h,
OkCodes: []int{201},
})
- res.Headers = resp.HttpResponse.Header
+ res.Header = resp.HttpResponse.Header
return res
}
@@ -316,7 +316,7 @@
MoreHeaders: c.Provider.AuthenticatedHeaders(),
OkCodes: []int{204},
})
- res.Headers = resp.HttpResponse.Header
+ res.Header = resp.HttpResponse.Header
res.Err = err
return res
}
@@ -361,7 +361,7 @@
MoreHeaders: c.Provider.AuthenticatedHeaders(),
OkCodes: []int{200, 204},
})
- res.Headers = resp.HttpResponse.Header
+ res.Header = resp.HttpResponse.Header
res.Err = err
return res
}
@@ -418,7 +418,7 @@
MoreHeaders: h,
OkCodes: []int{202},
})
- res.Headers = resp.HttpResponse.Header
+ 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 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.