s3: report http.StatusOK if the directory is explicitly created

fix https://github.com/seaweedfs/seaweedfs/issues/3457
This commit is contained in:
chrislu
2022-08-23 01:16:46 -07:00
parent 911475526c
commit 9fce75607d
3 changed files with 12 additions and 0 deletions

View File

@@ -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 {