On 03/13/2019 07:41 PM, [email protected] wrote:
> Author: covener
> Date: Wed Mar 13 18:41:30 2019
> New Revision: 1855449
>
> URL: http://svn.apache.org/viewvc?rev=1855449&view=rev
> Log:
> mod_mime: Add `MimeOptions`
>
> mod_mime: Add `MimeOptions` directive to allow Content-Type or all metadata
> detection to use only the last (right-most) file extension.
>
>
> Modified:
> httpd/httpd/trunk/CHANGES
> httpd/httpd/trunk/docs/manual/mod/mod_mime.xml
> httpd/httpd/trunk/modules/http/mod_mime.c
>
>
> Modified: httpd/httpd/trunk/docs/manual/mod/mod_mime.xml
> URL:
> http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_mime.xml?rev=1855449&r1=1855448&r2=1855449&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/docs/manual/mod/mod_mime.xml (original)
> +++ httpd/httpd/trunk/docs/manual/mod/mod_mime.xml Wed Mar 13 18:41:30 2019
> @@ -1051,4 +1051,38 @@ RemoveType .cgi
> <seealso><module>mod_mime_magic</module></seealso>
> </directivesynopsis>
>
> +<directivesynopsis>
> +<name>MimeOptions</name>
> +<description>Configures mod_mime behavior</description>
> +<syntax>MimeOptions<var>option</var> [<var>option</var>] ...</syntax>
> +<contextlist><context>server config</context>
> +<context>virtual host</context><context>directory</context>
> +<context>.htaccess</context>
> +<compatibility>IBM HTTP Server 9.0.0.12 and later</compatibility>
:-)
> Modified: httpd/httpd/trunk/modules/http/mod_mime.c
> URL:
> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/mod_mime.c?rev=1855449&r1=1855448&r2=1855449&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/http/mod_mime.c (original)
> +++ httpd/httpd/trunk/modules/http/mod_mime.c Wed Mar 13 18:41:30 2019
> @@ -364,6 +377,33 @@ static const char *multiviews_match(cmd_
> return NULL;
> }
>
> +static const char *add_mime_options(cmd_parms *cmd, void *in_dc,
> + const char *flag)
> +{
> + mime_dir_config *dc = in_dc;
> +
> + if (!strcasecmp(flag, "TypesLastExtension")) {
> + dc->ct_last_ext = CT_LAST_ON;
> + }
> + else if (!strcasecmp(flag, "NoTypesLastExtension")) {
> + dc->ct_last_ext = CT_LAST_OFF;
> + }
> + else if (!strcasecmp(flag, "AllLastExtension")) {
> + dc->all_last_ext = ALL_LAST_ON;
> + }
> + else if (!strcasecmp(flag, "AllLastExtension")) {
I guess it should be NoAllLastExtension.
> + dc->all_last_ext = ALL_LAST_OFF;
> + }
> + else {
> + return apr_pstrcat(cmd->temp_pool,
> + "Invalid MimeOptions option: ",
> + flag,
> + NULL);
> + }
> +
> + return NULL;
> +}
> +
> static const command_rec mime_cmds[] =
> {
> AP_INIT_ITERATE2("AddCharset", add_extension_info,
Regards
RĂ¼diger