Skip to content

Conversation

@erikmack
Copy link

@erikmack erikmack commented Feb 8, 2015

There is not a way currently to send user-defined headers when a file is PUT to the object store. Most notably, Content-Type can't be controlled and is instead guessed at the server or sent as application/octet-stream, which can break static web sites hosted on CDN. Currently, CloudFiles supports 14 headers to modify CDN behavior, but cloudfuse has no mechanism for making use of these headers.

A header specification is a mount option that can send (or omit) any number of user-defined headers, based on matches (or non-matches) on the path name. The specification looks like:

HeaderKey: [!]GlobPattern HeaderValue [, [!]GlobPattern HeaderValue...] [; HeaderKey:...]

For example:

Content-Type: *.jpg image/jpeg, ! *.txt text/html; Content-Disposition: * "attachment; filename=foo.txt"

See the README for more details. Unit tests are included via a new 'make tests' target. Thanks for considering accepting these changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant