cloudfuse icon indicating copy to clipboard operation
cloudfuse copied to clipboard

Feature: header specification

Open erikmack opened this issue 10 years ago • 0 comments

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.

erikmack avatar Feb 08 '15 17:02 erikmack