Now MinioAPI handles Content-MD5 set during putObject()

- This change also facilitates proper error response
    in case of md5 mismatch or corruption
  - TODO a test function needs to be implemented
This commit is contained in:
Harshavardhana
2015-03-17 13:32:10 -07:00
parent 42006c2ab0
commit 74b3d092f2
9 changed files with 118 additions and 33 deletions

View File

@@ -18,8 +18,6 @@ package encoded
import (
"bytes"
"crypto/md5"
"encoding/hex"
"errors"
"io"
"sort"
@@ -27,6 +25,9 @@ import (
"strings"
"time"
"crypto/md5"
"encoding/hex"
"github.com/minio-io/minio/pkg/donutbox"
"github.com/minio-io/minio/pkg/encoding/erasure"
"github.com/minio-io/minio/pkg/storage"
@@ -285,7 +286,7 @@ func beforeDelimiter(inputs []string, delim string) (results []string) {
}
// CreateObject creates a new object
func (diskStorage StorageDriver) CreateObject(bucketKey string, objectKey string, contentType string, reader io.Reader) error {
func (diskStorage StorageDriver) CreateObject(bucketKey, objectKey, contentType, md5sum string, reader io.Reader) error {
// set defaults
if contentType == "" {
contentType = "application/octet-stream"