Applicable in ObjectType-class directives.
The force-type function assigns a type to requests that do not already have a MIME type. This is used to specify a default object type.
Make sure that the directive that calls this function comes last in the list of ObjectType directives, so that all other ObjectType directives have a chance to set the MIME type first. If there is more than one ObjectType directive in an object, all of the directives are applied in the order they appear. If a directive sets an attribute and later directives try to set that attribute to something else, the first setting is used and the subsequent ones are ignored.
The following table describes parameters for the force-type function.
Table 5–69 force-type parameters
Parameter |
Description |
---|---|
(Optional) Type assigned to a matching request (the Content-Type header). |
|
(Optional) Encoding assigned to a matching request (the Content-Encoding header). |
|
(Optional) Language assigned to a matching request (the Content-Language header). |
|
(Optional) Character set for the magnus-charset parameter in rq->srvhdrs. If the browser sent the Accept-Charset header or its User-Agent is MozillaTM /1.1 or newer, then append “; charset=charset” to content-type, where charset is the value of the magnus-charset parameter in rq->srvhdrs. |
|
bucket |
(Optional) Common to all obj.conf functions. |
ObjectType fn=force-type type=text/plain ObjectType fn=force-type lang=en_US |