mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2026-04-25 13:26:00 +03:00
[GH-ISSUE #358] Directories are represented as files due to incomplete Content-Type parsing #181
Labels
No labels
bug
bug
dataloss
duplicate
enhancement
feature request
help wanted
invalid
need info
performance
pull-request
question
question
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/s3fs-fuse#181
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @yurykats on GitHub (Feb 8, 2016).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/358
When using s3fs with an S3-compatible storage provider, I came across a problem with directory representation. Directories were being represented as 0-byte files.
This happened because the storage provider returns Content-Type header with a charset parameter, eg Content-Type: application/octet-stream;charset=ISO-8859-1
s3fs_util.cpp does a literal comparison of the Content-Type header to predefined values, and thus fails, if the header contains optional charset parameter
The charset parameter inside the Content-Type header is perfectly legal both from HTTP and S3 point of view. S3 spec even shows it in its own example: http://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonResponseHeaders.html
Content-Type The MIME type of the content. For example, Content-Type: text/html; charset=utf-8
The code that parses the Content-Type header in s3fs_util.cpp should only consider the value up to the semi-colon.
@ggtakec commented on GitHub (Feb 11, 2016):
@yurykats I merged this PR, thank you for your help.