jim 00/02/03 06:22:36
Modified: htdocs/manual/mod core.html directives.html src CHANGES src/main http_core.c Log: Streamline the AddDefaultCharset directive. Now this one directive controls the entire 'charset' specification setup. If there is heartburn, I have no trouble with backing this out, but it makes live easier for those not using the "default" charset, and reduces directive bloat a bit :) Reviewed by: Martin Revision Changes Path 1.164 +9 -25 apache-1.3/htdocs/manual/mod/core.html Index: core.html =================================================================== RCS file: /export/home/cvs/apache-1.3/htdocs/manual/mod/core.html,v retrieving revision 1.163 retrieving revision 1.164 diff -u -r1.163 -r1.164 --- core.html 2000/02/02 20:43:11 1.163 +++ core.html 2000/02/03 14:22:25 1.164 @@ -24,7 +24,6 @@ <LI><A HREF="#accessconfig">AccessConfig</A> <LI><A HREF="#accessfilename">AccessFileName</A> <LI><A HREF="#adddefaultcharset">AddDefaultCharset</A> -<LI><A HREF="#adddefaultcharsetname">AddDefaultCharsetName</A> <LI><A HREF="#addmodule">AddModule</A> <LI><A HREF="#allowoverride">AllowOverride</A> <LI><A HREF="#authname">AuthName</A> @@ -167,38 +166,23 @@ <H2><A NAME="adddefaultcharset">AddDefaultCharset directive</A></H2> <A HREF="directive-dict.html#Syntax" REL="Help"><STRONG>Syntax:</STRONG></A> -AddDefaultCharset <EM>on / off</EM><BR> +AddDefaultCharset <EM>None / Default / charset</EM><BR> <A HREF="directive-dict.html#Context" REL="Help" ><STRONG>Context:</STRONG></A> all<BR> <A HREF="directive-dict.html#Status" REL="Help" ><STRONG>Status:</STRONG></A> core<BR> <A HREF="directive-dict.html#Default" REL="Help"><STRONG>Default:</STRONG></A> -<CODE>AddDefaultCharset off</CODE><BR> +<CODE>AddDefaultCharset None</CODE><BR> <A HREF="directive-dict.html#Compatibility" REL="Help"><STRONG>Compatibility: -</STRONG></A> AddDefaultCharset is only available in Apache 1.3.12 and later<P> -If enabled, any response that does not have any parameter on the content -type in the HTTP headers will have a charset parameter added specifying -the character set the client should use for the document. This will -override any character set specified in the body of the document via a -<CODE>META</CODE> tag. The character set added is specified by the -<CODE>AddDefaultCharsetName</CODE> directive. -<P><HR> - -<H2><A NAME="adddefaultcharsetname">AddDefaultCharsetName directive</A></H2> -<A HREF="directive-dict.html#Syntax" REL="Help"><STRONG>Syntax:</STRONG></A> -AddDefaultCharsetName <EM>charset</EM><BR> -<A HREF="directive-dict.html#Context" REL="Help" ><STRONG>Context:</STRONG></A> -all<BR> -<A HREF="directive-dict.html#Status" REL="Help" ><STRONG>Status:</STRONG></A> -core<BR> -<A HREF="directive-dict.html#Default" REL="Help"><STRONG>Default:</STRONG></A> -<CODE>AddDefaultCharsetName iso-8859-1</CODE><BR> -<A HREF="directive-dict.html#Compatibility" REL="Help"><STRONG>Compatibility: -</STRONG></A> AddDefaultCharsetName is only available in Apache 1.3.12 and +</STRONG></A> AddDefaultCharset is only available in Apache 1.3.12 and later<P> This directive specifies the name of the character set that will be added -if the <A HREF="#adddefaultcharset">AddDefaultCharset</A> directive is -enabled. +to any response that does not have any parameter on the content +type in the HTTP headers. This will override any character set specified +in the body of the document via a <CODE>META</CODE> tag. A setting +of <CODE>AddDefaultCharset None</CODE> disables this functionality. +<CODE>AddDefaultCharset Default</CODE> is the exact same as +<code>AddDefaultCharsetName iso-8859-1</code>. <P><HR> <H2><A NAME="addmodule">AddModule directive</A></H2> 1.63 +0 -1 apache-1.3/htdocs/manual/mod/directives.html Index: directives.html =================================================================== RCS file: /export/home/cvs/apache-1.3/htdocs/manual/mod/directives.html,v retrieving revision 1.62 retrieving revision 1.63 diff -u -r1.62 -r1.63 --- directives.html 2000/02/03 11:54:28 1.62 +++ directives.html 2000/02/03 14:22:26 1.63 @@ -32,7 +32,6 @@ <LI><A HREF="mod_autoindex.html#addaltbytype">AddAltByType</A> <LI><A HREF="mod_mime.html#addcharset">AddCharset</A> <LI><A HREF="core.html#adddefaultcharset">AddDefaultCharset</A> -<LI><A HREF="core.html#adddefaultcharsetname">AddDefaultCharsetName</A> <LI><A HREF="mod_autoindex.html#adddescription">AddDescription</A> <LI><A HREF="mod_mime.html#addencoding">AddEncoding</A> <LI><A HREF="mod_mime.html#addhandler">AddHandler</A> 1.1505 +3 -4 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1504 retrieving revision 1.1505 diff -u -r1.1504 -r1.1505 --- CHANGES 2000/02/02 20:43:28 1.1504 +++ CHANGES 2000/02/03 14:22:28 1.1505 @@ -4,10 +4,9 @@ ap_send_error_response(), such as the default 404 page. [Marc Slemko] - *) Add the AddDefaultCharset and AddDefaultCharsetName directives. - These allow you to tell Apache to specify the given character - set on any document that does not have one explicitly specified in - the headers. [Marc Slemko] + *) Add the AddDefaultCharset directive. This allows you to specify + the given character set on any document that does not have one + explicitly specified in the headers. [Marc Slemko, Jim Jagielski] *) Properly escape various messages output to the client from a number of modules and places in the core code. [Marc Slemko] 1.279 +12 -16 apache-1.3/src/main/http_core.c Index: http_core.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_core.c,v retrieving revision 1.278 retrieving revision 1.279 diff -u -r1.278 -r1.279 --- http_core.c 2000/02/02 20:43:46 1.278 +++ http_core.c 2000/02/03 14:22:33 1.279 @@ -1047,24 +1047,22 @@ #endif /*GPROF*/ static const char *set_add_default_charset(cmd_parms *cmd, - core_dir_config *d, int arg) -{ - const char *err = ap_check_cmd_context(cmd, NOT_IN_LIMIT); - if (err != NULL) { - return err; - } - d->add_default_charset = arg != 0; - return NULL; -} - -static const char *set_add_default_charset_name(cmd_parms *cmd, core_dir_config *d, char *arg) { const char *err = ap_check_cmd_context(cmd, NOT_IN_LIMIT); if (err != NULL) { return err; + } + if (!strcasecmp(arg, "None")) + d->add_default_charset = 0; + else if (!strcasecmp(arg, "Default")) { + d->add_default_charset = 1; + d->add_default_charset_name = DEFAULT_ADD_DEFAULT_CHARSET_NAME; + } + else { + d->add_default_charset = 1; + d->add_default_charset_name = arg; } - d->add_default_charset_name = arg; return NULL; } @@ -2819,10 +2817,8 @@ { "GprofDir", set_gprof_dir, NULL, RSRC_CONF, TAKE1, "Directory to plop gmon.out files" }, #endif -{ "AddDefaultCharset", set_add_default_charset, NULL, OR_FILEINFO, FLAG, - "whether or not to add a default charset to any Content-Type without one" }, -{ "AddDefaultCharsetName", set_add_default_charset_name, NULL, OR_FILEINFO, - TAKE1, "The name of the charset to add if AddDefaultCharset is enabled" }, +{ "AddDefaultCharset", set_add_default_charset, NULL, OR_FILEINFO, + TAKE1, "The name of the default charset to add to any Content-Type without one or 'None' to disable" }, /* Old resource config file commands */