Browse Source
weed/s3api: added new bucket handlers for more compatibility with AWS S3
weed/s3api: added new bucket handlers for more compatibility with AWS S3
Protocol Otherwise any requests to the underlying handlers results in calls to ListObjects (v1) that may intensively load gateway and volume servers. Added the following handlers with default responses: - GetBucketLocation - GetBucketRequestPayment Added the following handlers with NotFound and NotImplemented responses: - PutBucketAcl - GetBucketPolicy - PutBucketPolicy - DeleteBucketPolicy - GetBucketCors - PutBucketCors - DeleteBucketCorspull/2631/head
zerospiel
3 years ago
6 changed files with 107 additions and 22 deletions
-
19weed/s3api/s3api_bucket_handlers.go
-
49weed/s3api/s3api_bucket_skip_handlers.go
-
44weed/s3api/s3api_server.go
-
4weed/s3api/s3api_xsd_generated.go
-
1weed/s3api/s3err/s3-error.go
-
12weed/s3api/s3err/s3api_errors.go
@ -0,0 +1,49 @@ |
|||
package s3api |
|||
|
|||
import ( |
|||
"net/http" |
|||
|
|||
"github.com/chrislusf/seaweedfs/weed/s3api/s3err" |
|||
) |
|||
|
|||
// GetBucketCorsHandler Get bucket CORS
|
|||
// https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketCors.html
|
|||
func (s3a *S3ApiServer) GetBucketCorsHandler(w http.ResponseWriter, r *http.Request) { |
|||
s3err.WriteErrorResponse(w, r, s3err.ErrNoSuchCORSConfiguration) |
|||
} |
|||
|
|||
// PutBucketCorsHandler Put bucket CORS
|
|||
// https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketCors.html
|
|||
func (s3a *S3ApiServer) PutBucketCorsHandler(w http.ResponseWriter, r *http.Request) { |
|||
s3err.WriteErrorResponse(w, r, s3err.ErrNotImplemented) |
|||
} |
|||
|
|||
// DeleteBucketCorsHandler Delete bucket CORS
|
|||
// https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketCors.html
|
|||
func (s3a *S3ApiServer) DeleteBucketCorsHandler(w http.ResponseWriter, r *http.Request) { |
|||
s3err.WriteErrorResponse(w, r, http.StatusNoContent) |
|||
} |
|||
|
|||
// GetBucketPolicyHandler Get bucket Policy
|
|||
// https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicy.html
|
|||
func (s3a *S3ApiServer) GetBucketPolicyHandler(w http.ResponseWriter, r *http.Request) { |
|||
s3err.WriteErrorResponse(w, r, s3err.ErrNoSuchBucketPolicy) |
|||
} |
|||
|
|||
// PutBucketPolicyHandler Put bucket Policy
|
|||
// https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketPolicy.html
|
|||
func (s3a *S3ApiServer) PutBucketPolicyHandler(w http.ResponseWriter, r *http.Request) { |
|||
s3err.WriteErrorResponse(w, r, s3err.ErrNotImplemented) |
|||
} |
|||
|
|||
// DeleteBucketPolicyHandler Delete bucket Policy
|
|||
// https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketPolicy.html
|
|||
func (s3a *S3ApiServer) DeleteBucketPolicyHandler(w http.ResponseWriter, r *http.Request) { |
|||
s3err.WriteErrorResponse(w, r, http.StatusNoContent) |
|||
} |
|||
|
|||
// PutBucketAclHandler Put bucket ACL
|
|||
// https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAcl.html
|
|||
func (s3a *S3ApiServer) PutBucketAclHandler(w http.ResponseWriter, r *http.Request) { |
|||
s3err.WriteErrorResponse(w, r, s3err.ErrNotImplemented) |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue