Bug 33530

Summary: Truncated Content-Type string "Content-Type: ( with"
Product: Apache httpd-2 Reporter: Makoto Fujiwara <makoto>
Component: mod_mime_magicAssignee: Apache HTTPD Bugs Mailing List <bugs>
Severity: normal    
Priority: P2    
Version: 2.0.52   
Target Milestone: ---   
Hardware: Macintosh   
OS: NetBSD   

Description Makoto Fujiwara 2005-02-12 00:20:10 UTC
modules/metadata/mod_mime_magic.c has the following line.
   2016                 if (has_escapes)
   2017                     magic_rsl_puts(r, " (with escape sequences)");
   2018                 return 1;
But if this line is processed, the output will be
   Content-Encoding: (with 
Say, the string after embedded space is truncated.
If I put the hyphen(-) in place of spaces, say
   2017                     magic_rsl_puts(r, " (with-escape-sequences)");
server outputs entire string.
   Content-Encoding: (with-escape-sequences)

Some request_rec stored by following function may not be
processed correctly,
    542 static int magic_rsl_add(request_rec *r, char *str)
Comment 1 Makoto Fujiwara 2005-02-12 01:58:04 UTC
Reading following documentation tells me 
the value may not include 'white space'.

So the fix should be on the file
modules/metadata/mod_mime_magic.c, right ?

14.17 Content-Type

3.7 Media Types

Linear white space (LWS) MUST NOT be used between the type and
subtype, nor between an attribute and its value.
Comment 2 Joe Orton 2005-02-25 17:14:24 UTC
It's clearly wrong to generate a Content-Encoding like that.  What do you
propose, to fix this?  Just remove that magic_rsl_puts call completely?  Do you
have a file on which this path triggers?
Comment 3 Joe Orton 2005-02-25 17:16:52 UTC
Ah, this is actually a duplicate.

*** This bug has been marked as a duplicate of 17497 ***