aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/s3err
diff options
context:
space:
mode:
Diffstat (limited to 'weed/s3api/s3err')
-rw-r--r--weed/s3api/s3err/s3-error.go4
-rw-r--r--weed/s3api/s3err/s3api_errors.go8
2 files changed, 11 insertions, 1 deletions
diff --git a/weed/s3api/s3err/s3-error.go b/weed/s3api/s3err/s3-error.go
index b87764742..c5e515abd 100644
--- a/weed/s3api/s3err/s3-error.go
+++ b/weed/s3api/s3err/s3-error.go
@@ -1,5 +1,7 @@
package s3err
+import "github.com/seaweedfs/seaweedfs/weed/util/constants"
+
/*
* MinIO Go Library for Amazon S3 Compatible Cloud Storage
* Copyright 2015-2017 MinIO, Inc.
@@ -21,7 +23,7 @@ package s3err
// http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html
var s3ErrorResponseMap = map[string]string{
"AccessDenied": "Access Denied.",
- "BadDigest": "The Content-Md5 you specified did not match what we received.",
+ "BadDigest": constants.ErrMsgBadDigest,
"EntityTooSmall": "Your proposed upload is smaller than the minimum allowed object size.",
"EntityTooLarge": "Your proposed upload exceeds the maximum allowed object size.",
"IncompleteBody": "You did not provide the number of bytes specified by the Content-Length HTTP header.",
diff --git a/weed/s3api/s3err/s3api_errors.go b/weed/s3api/s3err/s3api_errors.go
index 3da79e817..24f8e1b56 100644
--- a/weed/s3api/s3err/s3api_errors.go
+++ b/weed/s3api/s3err/s3api_errors.go
@@ -4,6 +4,8 @@ import (
"encoding/xml"
"fmt"
"net/http"
+
+ "github.com/seaweedfs/seaweedfs/weed/util/constants"
)
// APIError structure
@@ -59,6 +61,7 @@ const (
ErrInvalidBucketName
ErrInvalidBucketState
ErrInvalidDigest
+ ErrBadDigest
ErrInvalidMaxKeys
ErrInvalidMaxUploads
ErrInvalidMaxParts
@@ -187,6 +190,11 @@ var errorCodeResponse = map[ErrorCode]APIError{
Description: "The Content-Md5 you specified is not valid.",
HTTPStatusCode: http.StatusBadRequest,
},
+ ErrBadDigest: {
+ Code: "BadDigest",
+ Description: constants.ErrMsgBadDigest,
+ HTTPStatusCode: http.StatusBadRequest,
+ },
ErrInvalidMaxUploads: {
Code: "InvalidArgument",
Description: "Argument max-uploads must be an integer between 0 and 2147483647",