>Number: 1799
>Category: mod_mime
>Synopsis: mod_mime's mapping to handler and content_type gets confused
>by some filenames
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: apache
>State: open
>Class: sw-bug
>Submitter-Id: apache
>Arrival-Date: Thu Feb 12 17:50:00 PST 1998
>Last-Modified:
>Originator: [EMAIL PROTECTED]
>Organization:
apache
>Release: 1.3b3
>Environment:
SunOS 5.5.1 Generic_103640-14 sun4u sparc SUNW,Ultra-1
gcc version 2.7.2.2
>Description:
If you've got a filename, with two substrings that qualify as extensions,
and one of them is bound to a handler and one of them is bound to a content-type
(map files and gifs, for instance), you'll end up with both the handler and
the content-type set. Since the handler takes precedence, this'll sometimes
do what you want and sometimes not. My problem case was a GIF named
assu.map.gif that'd end up getting handled by mod_imap.
>How-To-Repeat:
with mod_imap in your server, handling files with the ".map" ext,
name a gif "something.map.gif" then grab it, it'll be a broken
image because the map handler's trying to deliver it
>Fix:
Don't know if it's the best way, but I reset the handler
back to orighandler if the content-type gets set or
changed based a string later in the filename:
*** mod_mime.c.orig Thu Feb 12 16:31:53 1998
--- mod_mime.c Thu Feb 12 16:32:31 1998
***************
*** 256,261 ****
--- 256,262 ----
if ((type = table_get(conf->forced_types, ext))
|| (type = table_get(hash_buckets[hash(*ext)], ext))) {
r->content_type = type;
+ r->handler = orighandler;
found = 1;
}
%0
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <[EMAIL PROTECTED]> in the Cc line ]
[and leave the subject line UNCHANGED. This is not done]
[automatically because of the potential for mail loops. ]