I am having a strange problem with mod_perl/Apache::ASP

Randomly the mime type sent down to the browser is incorrect. This might be when the child processes its first request.

The content type is set to "text/html" and the header sent to the browser is:

Content-Type: text/plain; charset=UTF-8

I installed various warning output statements in the code to try to figure out where the problem lies.

content type before: 'text/html' after: 'text/html'
log content type: text/html
log content type: text/html

The first line is from inside of Apache::ASP::Response:

    my $before = $r->content_type;
    if(defined $self->{Charset}) {
    $r->content_type($self->{ContentType}.'; charset='.$self->{Charset});
    } else {
    $r->content_type($self->{ContentType}); # add content-type
    }
    my $after = $r->content_type;

    warn "content type before: '$before' after: '$after'";

The second two lines are from handlers I have installed to check the state of the response object:

    <Location />
        PerlLogHandler  Test::Apache::ContentTypeLog
        PerlCleanupHandler Test::Apache::ContentTypeLog
    </Location>

sub handler
{
    my $r = shift;
    warn "log content type: " . $r->content_type;
...

If I add AddType text/html .asp to my apache config then some of my _javascript_ files generated from asp pages randomly become text/html instead of text/_javascript_. This leads me to believe that sometimes the apache default is being used instead of what is specified in the request object.

Considering that the mime type of the response object is still being returned as its correct value in the PerlCleanupHandler it makes me think that this problem could be related to something in apache rather than mod_perl.

Any ideas?

Reply via email to