The following reply was made to PR general/2394; it has been noted by GNATS.
From: Dean Gaudet <[EMAIL PROTECTED]> To: Shawn Stepper <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] Subject: Re: general/2394: Content-Type header info converted to lowercase Date: Wed, 10 Jun 1998 02:09:31 -0700 (PDT) Bleh. Try this patch. Dean Index: include/httpd.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/httpd.h,v retrieving revision 1.222 diff -u -r1.222 httpd.h --- httpd.h 1998/06/07 01:22:36 1.222 +++ httpd.h 1998/06/10 08:57:15 @@ -896,6 +896,7 @@ API_EXPORT(char *) ap_pregsub(pool *p, const char *input, const char *source, size_t nmatch, regmatch_t pmatch[]); +API_EXPORT(void) ap_content_type_tolower(char *); API_EXPORT(void) ap_str_tolower(char *); API_EXPORT(int) ap_ind(const char *, char); /* Sigh... */ API_EXPORT(int) ap_rind(const char *, char); Index: main/util.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/util.c,v retrieving revision 1.119 diff -u -r1.119 util.c --- util.c 1998/06/06 19:30:48 1.119 +++ util.c 1998/06/10 08:57:16 @@ -1781,3 +1781,27 @@ return (time1 - time0); } #endif + +/* we want to downcase the type/subtype for comparison purposes + * but nothing else because ;parameter=foo values are case sensitive. + * XXX: in truth we want to downcase parameter names... but really, + * apache has never handled parameters and such correctly. You + * also need to compress spaces and such to be able to compare + * properly. -djg + */ +API_EXPORT(void) ap_content_type_tolower(char *str) +{ + char *semi; + + semi = strchr(str, ';'); + if (semi) { + *semi = '\0'; + } + while (*str) { + *str = tolower(*str); + ++str; + } + if (semi) { + *semi = ';'; + } +} Index: main/util_script.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/util_script.c,v retrieving revision 1.115 diff -u -r1.115 util_script.c --- util_script.c 1998/05/28 23:26:41 1.115 +++ util_script.c 1998/06/10 08:57:16 @@ -466,7 +466,7 @@ *endp-- = '\0'; r->content_type = ap_pstrdup(r->pool, l); - ap_str_tolower(r->content_type); + ap_content_type_tolower(r->content_type); } /* * If the script returned a specific status, that's what Index: modules/standard/mod_cern_meta.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_cern_meta.c,v retrieving revision 1.29 diff -u -r1.29 mod_cern_meta.c --- mod_cern_meta.c 1998/06/09 05:22:11 1.29 +++ mod_cern_meta.c 1998/06/10 08:57:17 @@ -269,7 +269,7 @@ *endp-- = '\0'; r->content_type = ap_pstrdup(r->pool, l); - ap_str_tolower(r->content_type); + ap_content_type_tolower(r->content_type); } else if (!strcasecmp(w, "Status")) { sscanf(l, "%d", &r->status); Index: modules/standard/mod_mime_magic.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_mime_magic.c,v retrieving revision 1.33 diff -u -r1.33 mod_mime_magic.c --- mod_mime_magic.c 1998/05/28 22:09:57 1.33 +++ mod_mime_magic.c 1998/06/10 08:57:17 @@ -816,7 +816,7 @@ r->content_type = rsl_strdup(r, type_frag, type_pos, type_len); /* XXX: this could be done at config time I'm sure... but I'm * confused by all this magic_rsl stuff. -djg */ - ap_str_tolower(r->content_type); + ap_content_type_tolower(r->content_type); } if (state == rsl_encoding) { r->content_encoding = rsl_strdup(r, encoding_frag,