mirror of
https://github.com/minio/minio.git
synced 2025-11-10 05:59:43 -05:00
xl,fs: Return 404 if object ends with a separator (#3897)
HEAD Object for FS and XL was returning invalid object name when an object name has a trailing slash separator, this PR changes the behavior and will always return 404 object not found, this guarantees a better compatibility with S3 spec.
This commit is contained in:
committed by
Harshavardhana
parent
5f7565762e
commit
a5e60706a2
@@ -470,6 +470,12 @@ func (fs fsObjects) getObjectInfo(bucket, object string) (ObjectInfo, error) {
|
||||
|
||||
// GetObjectInfo - reads object metadata and replies back ObjectInfo.
|
||||
func (fs fsObjects) GetObjectInfo(bucket, object string) (ObjectInfo, error) {
|
||||
// This is a special case with object whose name ends with
|
||||
// a slash separator, we always return object not found here.
|
||||
if hasSuffix(object, slashSeparator) {
|
||||
return ObjectInfo{}, toObjectErr(traceError(errFileNotFound), bucket, object)
|
||||
}
|
||||
|
||||
if err := checkGetObjArgs(bucket, object); err != nil {
|
||||
return ObjectInfo{}, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user