mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
s3: fix regression on HEAD directory operation
This commit is contained in:
parent
4573c99ae3
commit
42c6e52513
|
@ -388,6 +388,18 @@ func (s3a *S3ApiServer) proxyToFiler(w http.ResponseWriter, r *http.Request, des
|
|||
}
|
||||
}
|
||||
|
||||
if resp.StatusCode == http.StatusNotFound {
|
||||
s3err.WriteErrorResponse(w, r, s3err.ErrNoSuchKey)
|
||||
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 {
|
||||
s3err.WriteErrorResponse(w, r, s3err.ErrNoSuchKey)
|
||||
return
|
||||
}
|
||||
|
||||
responseStatusCode := responseFn(resp, w)
|
||||
s3err.PostLog(r, responseStatusCode, s3err.ErrNone)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue