diff options
Diffstat (limited to 'weed/s3api')
| -rw-r--r-- | weed/s3api/s3_constants/header.go | 2 | ||||
| -rw-r--r-- | weed/s3api/s3api_object_handlers.go | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/weed/s3api/s3_constants/header.go b/weed/s3api/s3_constants/header.go index cd725d435..a18955185 100644 --- a/weed/s3api/s3_constants/header.go +++ b/weed/s3api/s3_constants/header.go @@ -36,6 +36,8 @@ const ( AmzObjectTaggingPrefix = "X-Amz-Tagging-" AmzObjectTaggingDirective = "X-Amz-Tagging-Directive" AmzTagCount = "x-amz-tagging-count" + + X_SeaweedFS_Header_Directory_Key = "x-seaweedfs-is-directory-key" ) // Non-Standard S3 HTTP request constants diff --git a/weed/s3api/s3api_object_handlers.go b/weed/s3api/s3api_object_handlers.go index 5ff98e022..1525889fd 100644 --- a/weed/s3api/s3api_object_handlers.go +++ b/weed/s3api/s3api_object_handlers.go @@ -393,6 +393,12 @@ func (s3a *S3ApiServer) proxyToFiler(w http.ResponseWriter, r *http.Request, des return } + if resp.Header.Get(s3_constants.X_SeaweedFS_Header_Directory_Key) == "true" { + responseStatusCode := responseFn(resp, w) + s3err.PostLog(r, responseStatusCode, s3err.ErrNone) + return + } + // when HEAD a directory, it should be reported as no such key // https://github.com/seaweedfs/seaweedfs/issues/3457 if resp.ContentLength == -1 && resp.StatusCode != http.StatusNotModified { |
