mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-09 15:57:47 +02:00
* s3: answer application/x-directory for a directory without a stored mime A real directory reached via a trailing-slash GET/HEAD answered the octet-stream default when it had no stored mime, so Hadoop-style S3 filesystems (flink-s3-fs-presto and friends) classified the path as a 0-byte file instead of a directory and then failed reading it as one. Answer application/x-directory, the marker type those clients probe for. Stored mimes still echo verbatim, and a file promoted to a directory keeps octet-stream for its data. * s3: 404 GET and HEAD on a bare directory path consistently A directory with no object data of its own answered differently per path: plain GET gave an empty 200, ranged GET and non-versioned HEAD gave 404, and on versioned buckets the null-version fallback adopted the filer directory as a 0-byte object and answered 200. Clients that probe HEAD-then-GET took the 200s at face value, treated the path as an empty file, and never fell back to LIST-based directory discovery. Answer 404 for a bare directory path everywhere, which is what AWS returns for a prefix. A file promoted to a directory keeps its data and stays retrievable.
26 lines
1.1 KiB
Go
26 lines
1.1 KiB
Go
package s3_constants
|
|
|
|
const (
|
|
ACTION_READ = "Read"
|
|
ACTION_READ_ACP = "ReadAcp"
|
|
ACTION_WRITE = "Write"
|
|
ACTION_WRITE_ACP = "WriteAcp"
|
|
ACTION_ADMIN = "Admin"
|
|
ACTION_TAGGING = "Tagging"
|
|
ACTION_LIST = "List"
|
|
ACTION_DELETE_BUCKET = "DeleteBucket"
|
|
ACTION_BYPASS_GOVERNANCE_RETENTION = "BypassGovernanceRetention"
|
|
ACTION_GET_OBJECT_RETENTION = "GetObjectRetention"
|
|
ACTION_PUT_OBJECT_RETENTION = "PutObjectRetention"
|
|
ACTION_GET_OBJECT_LEGAL_HOLD = "GetObjectLegalHold"
|
|
ACTION_PUT_OBJECT_LEGAL_HOLD = "PutObjectLegalHold"
|
|
ACTION_GET_BUCKET_OBJECT_LOCK_CONFIG = "GetBucketObjectLockConfiguration"
|
|
ACTION_PUT_BUCKET_OBJECT_LOCK_CONFIG = "PutBucketObjectLockConfiguration"
|
|
|
|
SeaweedStorageDestinationHeader = "x-seaweedfs-destination"
|
|
MultipartUploadsFolder = ".uploads"
|
|
VersionsFolder = ".versions"
|
|
FolderMimeType = "httpd/unix-directory"
|
|
DirectoryMimeType = "application/x-directory"
|
|
)
|