HTTP header Content-Length signifies body length of the request, if its smaller reply appropriately

This patch also handles large individual part sizes > 5MB by using less memory copies.
This commit is contained in:
Harshavardhana
2015-07-08 20:18:32 -07:00
parent cea093bf65
commit 375860077d
5 changed files with 61 additions and 23 deletions
+3 -3
View File
@@ -124,7 +124,7 @@ func (r *request) getHashedPayload() string {
}
}
hashedPayload := hash()
r.calculatedReq.Header.Set("X-Amz-Content-Sha256", hashedPayload)
r.calculatedReq.Header.Set("x-amz-content-sha256", hashedPayload)
return hashedPayload
}
@@ -241,8 +241,8 @@ func (r *request) getSignature(signingKey []byte, stringToSign string) string {
func (r *request) SignV4() (string, error) {
// Add date if not present
var date string
if date = r.calculatedReq.Header.Get("Date"); date == "" {
if date = r.calculatedReq.Header.Get("X-Amz-Date"); date == "" {
if date = r.calculatedReq.Header.Get("x-amz-date"); date == "" {
if date = r.calculatedReq.Header.Get("Date"); date == "" {
return "", iodine.New(MissingDateHeader{}, nil)
}
}