[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: redirect.pl sez Content-Type: application/x-perl



Josip Rodin said:
> On Wed, Oct 23, 2002 at 10:07:46PM -0400, Lou Poppler wrote:
> > > > This script produces a 302 redirect response, but it unfortunately
> > > > contains a header which confuses my antique browser, specifically
> > > > the last "Content-Type: application/x-perl                              "
> > > > 
> > > > HTTP/1.1 302 Moved                                        
> > > > Date: Wed, 23 Oct 2002 19:43:53 GMT
> > > > Server: Apache/1.3.9 (Unix) Debian/GNU PHP/4.0.3pl1             
> > > > Location: http://www.us.debian.org/
> > > > Connection: close                                                   
> > > > Content-Type: application/x-perl                              
> > > > 
> > > > Is it really necessary to insert this strange header in a redirect ?
> > > > (especially since the content length of the reply is zero.)
> > > 
> > > Hmm. This is added by our Apache. I don't know offhand if and how we could
> > > remove it.
> > > 
> > > What browser is this?
> > 
> > Lynx Version 2.6
> > 
> > Yes, yes, I know.  That's a part of the reason I'm trying to poke around
> > debian's website in the first place.
> > 
> > If it can't be removed, maybe it could instead say:
> > Content-Type: text/html
> 
> Hmm, you're right, I suppose it should do that. Maybe an even smarter thing
> would be to ditch the redirect script and just use a server redirect.

This can be explicitly forced using the Apache configuration directive:

<DirectoryMatch cgi-bin>
	RemoveType .pl
</DirectoryMatch>

This will (hopefully) result in the output of redirect.pl being served
as "text/html" rather than "application/x-perl", assuming "text/html" is
the default type set with DefaultType in httpd.conf ...

Another way of doing it would be to have the redirect.pl script supply
its own Content-Type header.  Yet another way would be with the Apache
configuration directive AddType.

<DirectoryMatch cgi-bin>
	AddType text/html .pl
</DirectoryMatch>

This would need to be done on cgi.debian.org, obviously.

I think that fixing redirect.pl to send its own header would be the best
solution, as the RemoveType and AddType directives could break the
behaviour of other .pl scripts in the cgi-bin directory.

See /doc/apache/manual/mod/mod_mime.html.en for more information.

Andrew.

-- 
Andrew Shugg <andrew@neep.com.au>                   http://www.neep.com.au/

"Just remember, Mr Fawlty, there's always someone worse off than yourself."
"Is there?  Well I'd like to meet him.  I could do with a good laugh."



Reply to: