Add proper content-length for error and success responses

- All compliance issues with S3 API for Put,Get,List (Bucket,Object) respectively
 - Encodes and returns back proper HTTP headers
This commit is contained in:
Harshavardhana
2015-04-29 15:28:04 -07:00
parent c8db3e1c3b
commit 92e4301414
7 changed files with 117 additions and 64 deletions
+6 -6
View File
@@ -25,8 +25,8 @@ const (
maxObjectList = 1000
)
// ObjectListResponse format
type ObjectListResponse struct {
// ListObjectsResponse - format for list objects response
type ListObjectsResponse struct {
XMLName xml.Name `xml:"ListBucketResult" json:"-"`
Name string
Prefix string
@@ -38,8 +38,8 @@ type ObjectListResponse struct {
CommonPrefixes []*Prefix
}
// BucketListResponse - bucket list response format
type BucketListResponse struct {
// ListBucketsResponse - format for list buckets response
type ListBucketsResponse struct {
XMLName xml.Name `xml:"ListAllMyBucketsResult" json:"-"`
Owner Owner
Buckets struct {
@@ -75,7 +75,7 @@ type Owner struct {
}
// List of not implemented bucket queries
var unimplementedBucketResourceNames = map[string]bool{
var notimplementedBucketResourceNames = map[string]bool{
"policy": true,
"cors": true,
"lifecycle": true,
@@ -91,7 +91,7 @@ var unimplementedBucketResourceNames = map[string]bool{
}
// List of not implemented object queries
var unimplementedObjectResourceNames = map[string]bool{
var notimplementedObjectResourceNames = map[string]bool{
"uploadId": true,
"torrent": true,
"uploads": true,