You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Phil's Yahoo <ph...@yahoo.co.uk> on 2005/02/24 18:18:14 UTC

HTML code shown not HTML

i have updated my http.conf so that "PerlSendHeaders Off"
i also have put a empty line after the content type in file
i have also changed "Content-type" to "Content-Type"
and still the script is showing HTML code and not displaying the page as 
HTML.
the code i am using is a CGIproxy script from 
http://www.jmarshall.com/tools/cgiproxy/
to make things more interesting none of the headers will work at all
Location -----> doesnt work for redirecting
Content-Length ---->doesnt work

i have no idea why this is happening because headers is one of the first 
things in all
tutorials so i thought that it would be preatty standard.
is this a problem with

    * Apache
    * Perl
    * CGIProxy

just wondering.
any help would be very usefull
phil


Re: Problem with mod_perl/apache Headers

Posted by Torsten Foertsch <to...@gmx.net>.
On Thursday 24 February 2005 19:48, Phil's Yahoo wrote:
> [root@p15162004 root]# curl -v www.anfmailorder.com/proxy/test.pl
> * About to connect() to www.anfmailorder.com:80
> * Connected to p15162004.pureserver.info (217.160.184.86) port 80
>  > GET /proxy/test.pl HTTP/1.1
> User-Agent: curl/7.9.8 (i386-redhat-linux-gnu) libcurl 7.9.8 (OpenSSL
> 0.9.7a) (ipv6 enabled)
> Host: www.anfmailorder.com
> Pragma: no-cache
> Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
the next (empty) line is the last line of the request
>
and here comes the first one of the answer. The status line ("HTTP/1.1 
200 OK" or so) is missing.
> Content-type: text/html
>
> Hello, world!
> * Closing connection #0
> [root@p15162004 root]#
> END
>
> any ideas how to remove this extra line or how to append the header
> onto the end of the headers???

Not if you don't reveal more of your setup and test.pl.

I think, test.pl is simply printing "Content-type: text/html\n\n...". Is 
it running under mod_perl or mod_cgi? Apache::Registry? SetHandler 
modperl or perl-script? mp1 or mp2?

If mp2 this may help:
  http://perl.apache.org/docs/2.0/user/config/config.html#C_ParseHeaders_

Torsten

Problem with mod_perl/apache Headers

Posted by Phil's Yahoo <ph...@yahoo.co.uk>.
i have traced the problem with the headers by using "curl -v" on the address
and i think the problem is because after apache has sent the headers it 
inserts a empty
line so that when i print headers in perl i just writes the text and 
egnores the headers.
the following is the exact output of the page.
START
[root@p15162004 root]# curl -v www.anfmailorder.com/proxy/test.pl
* About to connect() to www.anfmailorder.com:80
* Connected to p15162004.pureserver.info (217.160.184.86) port 80
 > GET /proxy/test.pl HTTP/1.1
User-Agent: curl/7.9.8 (i386-redhat-linux-gnu) libcurl 7.9.8 (OpenSSL 
0.9.7a) (ipv6 enabled)
Host: www.anfmailorder.com
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*

Content-type: text/html

Hello, world!
* Closing connection #0
[root@p15162004 root]#
END

any ideas how to remove this extra line or how to append the header onto 
the end of the headers???


Re: HTML code shown not HTML

Posted by Torsten Foertsch <to...@gmx.net>.
On Thursday 24 February 2005 18:18, you wrote:
> i have updated my http.conf so that "PerlSendHeaders Off"
> i also have put a empty line after the content type in file
> i have also changed "Content-type" to "Content-Type"
> and still the script is showing HTML code and not displaying the page
> as HTML.
> the code i am using is a CGIproxy script from
> http://www.jmarshall.com/tools/cgiproxy/
> to make things more interesting none of the headers will work at all
> Location -----> doesnt work for redirecting
> Content-Length ---->doesnt work
>
is there an empty line after the last header? You can check it with 
"curl -v" or telnet.

Torsten