api: verify Location constraint for make bucket. (#1342)

This commit is contained in:
karthic rao
2016-04-21 06:05:38 +05:30
committed by Harshavardhana
parent c3d0a3d51e
commit cb1116725b
5 changed files with 123 additions and 27 deletions
+9 -2
View File
@@ -18,11 +18,18 @@ package main
import (
"encoding/base64"
"strings"
"encoding/xml"
"github.com/minio/minio/pkg/probe"
"io"
"strings"
)
// xmlDecoder provide decoded value in xml.
func xmlDecoder(body io.Reader, v interface{}) error {
d := xml.NewDecoder(body)
return d.Decode(v)
}
// checkValidMD5 - verify if valid md5, returns md5 in bytes.
func checkValidMD5(md5 string) ([]byte, *probe.Error) {
md5Bytes, e := base64.StdEncoding.DecodeString(strings.TrimSpace(md5))