redbo / cloudfuse

Filesystem (fuse) implemented on Mosso's Cloud Files
http://redbo.github.com/cloudfuse/
MIT License
392 stars 114 forks source link

Incorrect MIME type #32

Open geraldcombs opened 12 years ago

geraldcombs commented 12 years ago

It looks like cloudfuse sets the content type for every file to application/octet-stream. This can cause problems when using RSCF as a CDN. For example, Chrome and Firefox will reject CSS files served as application/octet-stream.

ghost commented 10 years ago

I too have an issue with this... Has anyone looked into why the content type gets munged?

redbo commented 10 years ago

Cloudfuse doesn't set a content-type, so swift (/cloud files) should just choose one based on the file's extension. If you can run cloudfuse with the -d flag and share some of the output, it might help figure out what's going on. Here are the headers from a test I just did, where it gets set correctly:

PUT /v1/MossoCloudFS_8ef18146-7dd3-46ea-9d61-b07a511b0c81/test/somefile.css HTTP/1.1
User-Agent: CloudFuse
Host: storage101.ord1.clouddrive.com
Accept: */*
X-Auth-Token: a6264b3d7fa74b61a8dd46d72acfa66a
Content-Length: 0
Expect: 100-continue
GET /v1/MossoCloudFS_8ef18146-7dd3-46ea-9d61-b07a511b0c81/test/somefile.css HTTP/1.1
User-Agent: CloudFuse
Host: storage101.ord1.clouddrive.com
Accept: */*
X-Auth-Token: a6264b3d7fa74b61a8dd46d72acfa66a

< HTTP/1.1 200 OK
< Content-Length: 0
< Accept-Ranges: bytes
< Last-Modified: Tue, 21 Jan 2014 22:11:53 GMT
< Etag: d41d8cd98f00b204e9800998ecf8427e
< X-Timestamp: 1390342313.42697
< Content-Type: text/css
< X-Trans-Id: txd62ba63d6c7740719dcd9-0052def0c4ord1
< Date: Tue, 21 Jan 2014 22:12:20 GMT