configurations in <Location> or <Proxy> context. PR 63256. [Yann Ylavic]
*) mod_mime: Add `MimeOptions` directive to allow Content-Type or all metadata
- detection to use only the last (right-most) file extension. [Eric Covener]
+ detection to use only the last (right-most) file extension or to be
+ disabled per-dir. [Eric Covener]
*) MPMs unix: bind the bucket number of each child to its slot number, for a
more efficient per bucket maintenance. [Yann Ylavic]
<dd>This option can be used to revert to the default behavior of testing
every filename extension when determining any response metadata
(Content-Type, language, encoding, etc.) .</dd>
+ <dt><code>Disable</code></dt>
+ <dd>All assignment of metadata based on the filename is skipped.</dd>
+ <dt><code>Enable</code></dt>
+ <dd>Re-enables assignment of metadata based on the filename. Only useful if a lower
+ precedence section has specified <code>MimeOptions Disable</code>.</dd>
</dl>
</usage>
</directivesynopsis>
enum {CT_LAST_INIT, CT_LAST_ON, CT_LAST_OFF} ct_last_ext;
/* Only use the final extension for anything */
enum {ALL_LAST_INIT, ALL_LAST_ON, ALL_LAST_OFF} all_last_ext;
+ /* don't do any detection */
+ enum {NOMIME_INIT, NOMIME_ON, NOMIME_OFF} nomime;
} mime_dir_config;
typedef struct param_s {
new->all_last_ext = (add->all_last_ext != ALL_LAST_INIT)
? add->all_last_ext
: base->all_last_ext;
+ new->nomime = (add->nomime != NOMIME_INIT)
+ ? add->nomime
+ : base->nomime;
+
return new;
}
else if (!strcasecmp(flag, "NoAllLastExtension")) {
dc->all_last_ext = ALL_LAST_OFF;
}
+ else if (!strcasecmp(flag, "Disable")) {
+ dc->nomime = NOMIME_ON;
+ }
+ else if (!strcasecmp(flag, "Enable")) {
+ dc->nomime = NOMIME_OFF;
+ }
else {
return apr_pstrcat(cmd->temp_pool,
"Invalid MimeOptions option: ",
conf = (mime_dir_config *)ap_get_module_config(r->per_dir_config,
&mime_module);
+ if (conf->nomime == NOMIME_ON) {
+ return DECLINED;
+ }
+
exception_list = apr_array_make(r->pool, 2, sizeof(char *));
/* If use_path_info is explicitly set to on (value & 1 == 1), append. */