You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Petr Lampa <la...@fee.vutbr.cz> on 1997/02/05 23:20:02 UTC

general/160: invoke_handler() doesn't handle mime arguments in content-type

>Number:         160
>Category:       general
>Synopsis:       invoke_handler() doesn't handle mime arguments in content-type
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Wed Feb  5 14:20:02 1997
>Originator:     lampa@fee.vutbr.cz
>Organization:
apache
>Release:        1.2b2, b3, b4, b6
>Environment:
FreeBSD-2.2BETA
>Description:
Problem reported for 1.2b2, still unresolved.

The member r->content_type should contain charset specification to
get proper header, but invoke_handler() in http_config.c doesn't parse
content_type arguments and in this case doesn't select proper handler.
Handling should be consistent, if content_type may contain arguments 
(text/html; charset=ISO-8859-2), then invoke_handler() should accept it.
>How-To-Repeat:

>Fix:
Add after this line in invoke_handler():

 char *content_type = r->content_type ? r->content_type : default_type (r);

something like this:

char *p;
if ((p = strchr(r->content_type, ';')) != NULL) {
    while (p > r->content_type && --*p == ' '); /* strip trailing spaces */
    content_type = pstrndup(r->pool, r->content_type, p - r->content_type);
}


%0
>Audit-Trail:
>Unformatted: