signature: Fix signature handling of parallel requests.

Signature struct should be immutable, this fixes an issue
with AWS cli not being able to do multipart put operations.
This commit is contained in:
Harshavardhana
2016-03-02 11:22:58 -08:00
parent b37fbabe7f
commit 17d145df3a
3 changed files with 42 additions and 34 deletions

View File

@@ -74,13 +74,13 @@ func New(accessKeyID, secretAccessKey, region string) (*Sign, *probe.Error) {
}
// SetHTTPRequestToVerify - sets the http request which needs to be verified.
func (s *Sign) SetHTTPRequestToVerify(r *http.Request) *Sign {
func (s *Sign) SetHTTPRequestToVerify(r *http.Request) Sign {
// Do not set http request if its 'nil'.
if r == nil {
return s
return *s
}
s.httpRequest = r
return s
return *s
}
// getCanonicalHeaders generate a list of request headers with their values