David
Fri May 11 17:40:02 CDT 2007
Thanks for providing the response.
The problem is either with your Perl script and/or some custom ISAPI
Filter on the server. Your IIS configuration is fine, and the Perl
script is executing.
HTTP/1.1 200 OK\r\n
Date: Fri, 11 May 2007 13:58:54 GMT\r\n
Server: Microsoft-IIS/6.0\r\n
\r\n
Content-Type: text/html; charset=3DISO-8859-1\r\n
\r\n
The reason the browser did not render the response as HTML is because
the "Content-Type: text/html" response header, which tells the browser
that the entity body is HTML and should be rendered as HTML, is
*AFTER* the first double \r\n. The significance of the double \r\n --
it is the boundary between response headers (in front of the first
double \r\n) and response entity body (anything after the first double
\r\n).
You can view response headers as "instructions" to the receiving agent
on how to handle the entity body "payload". Thus, Content-Type: text/
html as response header tells the browser to render the entity body as
HTML, while Content-Type: text/html as response entity body will be
merely displayed as-is by the browser.
In your response, the Content-Type: text/html text came *AFTER* the
first double \r\n, which means it is considered part of the entity
body. Thus, the browser got headers that indicate nothing about the
response content type nor length, so it just displayed it all as-is
and not rendered as HTML. No, web browsers do not automatically render
everything as an HTML web pages even though everyone calls them "web"
browsers -- they follow instructions in response Content-Type to
launch the appropriate client-side agent to render the entity body.
Browser behavior is undefined when Content-Type is absent, so you
cannot demand/rely on any specific behavior.
Why the Content-Type: response header is in the wrong place -- I
highly suspect it is a bug in the Perl script. You should contact
support personnel for your Perl script.
//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//
On May 11, 11:00 am, sefs <sefs...@yahoo.com> wrote:
> Hi there here is the response from wfetch, I used all the default
> settings just inputted the host name and path to the perl script.
>
> I have also attached it as a text file in case it does not display well
> in the post...
>
> **** start log
>
> started....
> WWWConnect::Close("agriculture.gov.bb","80")\n
> closed source port: 3261\r\n
> WWWConnect::Connect("agriculture.gov.bb","80")\n
> source port: 3274\r\n
> REQUEST: **************\n
> GET /library/cgi-bin/perldiver.pl HTTP/1.1\r\n
> Host: agriculture.gov.bb\r\n
> Accept: */*\r\n
> \r\n
> RESPONSE: **************\n
> HTTP/1.1 200 OK\r\n
> Date: Fri, 11 May 2007 13:58:54 GMT\r\n
> Server: Microsoft-IIS/6.0\r\n
> \r\n
> Content-Type: text/html; charset=3DISO-8859-1\r\n
> \r\n
> <!DOCTYPE html\n
> \tPUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n
> \t "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n
> <html xmlns=3D"
http://www.w3.org/1999/xhtml" lang=3D"en-US" xml:lang=3D"e=
n-US">\n
> <head>\n
> <title>Perl Diver : Main</title>\n
> <style type=3D"text/css">\n
> <!--/* <![CDATA[ */\n
> body {\n
> background: "#FFFFF";\n
> scrollbar-face-color: "#FFCC66";\n
> scrollbar-shadow-color: "#FF6600";\n
> scrollbar-highlight-color: "#FFCC66";\n
> scrollbar-3dlight-color: "#FFFFFF";\n
> scrollbar-darkshadow-color: "#000000";\n
> scrollbar-track-color: "#E2DAD1";\n
> scrollbar-arrow-color: "#000000";\n
> font-size: "x-small";\n
> font-family: "arial,helvetica,sans-serif"\n
> }\n
> A:hover {\n
> background: "#ffcc66";\n
> color: "#336699";\n
> text-decoration: "overline"\n
> }\n
> A:link {\n
> color: "#BF0425"\n
> }\n
> A:visited {\n
> color: "#336699"\n
> }\n
> th,td,p {\n
> font-size: "x-small"\n
> }\n
> .label {\n
> font-family: "Geneva, Helvetica, sans serif";\n
> font-size: "x-small";\n
> font-weight: bold\n
> }\n
> .HL {\n
> font-size:\t"20pt";\n
>
> letter-spacing:\t".5pt";\n
> font-family: "geneva, arial, sans-serif";\n
> background: "#FDB900";\n
> }\n
> .heading {\n
> font-size: "x-large";\n
> letter-spacing:\t".5pt"\n
> }\n
> .a1 {\n
> background: wheat\n
> }\n
> .a2 {\n
> background: linen\n
> }\n
> .a3 {\n
> background: blanchedalmond\n
> }\n
> .progname {\n
> color: #bf0425;\n
> font-size: xx-large;\n
> }\n
> code,pre {\n
> font-face: "Courier New", mono;\n
> font-size: 11pt;\n
> }\n
> \n
> \n
> \n
> /* ]]> */-->\n
> </style>\n
> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-885=
9-1" />\n
> </head>\n
> <body>\n
> <div class=3D"progname">Perl Diver 2.33</div>
> <table bgcolor=3D"black" border=3D"0" cellspacing=3D"0" cellpadding=3D"1"
> width=3D"100%"><tr><td><table bgcolor=3D"white" cellspacing=3D"0"
> cellpadding=3D"1" width=3D"100
> %"><tr><th class=3D"a1">Main</th> <th class=3D"a2"><a
> href=3D"perldiver.pl?action=3D20">Environment Variables</a></th> <th
> class=3D"a3"><a href=3D"perldiver.pl?act
> ion=3D30">Perl Default Values</a></th> <th class=3D"a1"><a
> href=3D"perldiver.pl?action=3D40">Perl Config - Summary</a></th> <th
> class=3D"a2"><a href=3D"perldiver.p
> l?action=3D50">Perl Config - Full</a></th> <th class=3D"a3"><a
> href=3D"perldiver.pl?action=3D60">Installed Modules</a></th> <th
> class=3D"a1"><a href=3D"perldiver.p
> l?action=3D65">List Directory</a></th> <th class=3D"a2"><a
> href=3D"perldiver.pl?action=3D66">uptime</a></th> <th class=3D"a3"><a
> href=3D"perldiver.pl?action=3D2000">
> Docs</a></th></tr></table></td></tr></table><p /><table bgcolor=3D"black"
> border=3D"0" cellspacing=3D"0" cellpadding=3D"1" width=3D"100%"><tr><td><=
table
> bgcolor=3D
> "white" cellspacing=3D"0" cellpadding=3D"1" width=3D"100%"><tr
> class=3D"HL"><th><span class=3D"heading">Main</span></th></tr><tr><td>Bas=
ic
> paths and information<
> /td></tr></table></td></tr></table><p /><table bgcolor=3D"black"
> border=3D"0" cellspacing=3D"0" cellpadding=3D"1" width=3D"100%"><tr><td><=
table
> bgcolor=3D"white" c
> ellspacing=3D"0" cellpadding=3D"1" width=3D"100%"><tr class=3D"a1"><td
> class=3D"label" valign=3D"top">Perl Executable</td> <td
> class=3D"value">C:\Perl\bin\perlis.dll
> </td></tr>\n
> <tr class=3D"a2"><td class=3D"label" valign=3D"top">Perl version</td> <td
> class=3D"value">5.008008</td></tr>\n
> <tr class=3D"a3"><td class=3D"label" valign=3D"top">Operating System Name=
</td>
> <td class=3D"value">MSWin32</td></tr>\n
> <tr class=3D"a1"><td class=3D"label" valign=3D"top">GID (If not blank, yo=
u are
> on a machine that supports membership in multiple groups
> simultaneously)</td>
> <td class=3D"value">0</td></tr>\n
> <tr class=3D"a2"><td class=3D"label" valign=3D"top">Path to Perl</td> <td
> class=3D"value"></td></tr>\n
> <tr class=3D"a3"><td class=3D"label" valign=3D"top">Path to sendmail</td>=
<td
> class=3D"value"></td></tr>\n
> <tr class=3D"a1"><td class
> =3D"label" valign=3D"top">Directories searched for perl modules</td> <td
> class=3D"value">C:/websites/barbados.gov.bb/www/agriculture/library/cgi-b=
in/<=ADbr
> />C:/
> Perl/site/lib<br />C:/Perl/lib<br
> />.</td></tr></table></td></tr></table><p /><table bgcolor=3D"black"
> border=3D"0" cellspacing=3D"0" cellpadding=3D"1" width=3D"
> 100%"><tr><td><table bgcolor=3D"white" cellspacing=3D"0" cellpadding=3D"1"
> width=3D"100%"><tr class=3D"HL"><th>Perl Diver brought to you by <a
> href=3D"
http://scrip
> tsolutions.com">ScriptSolutions.com</a> © 1997-
> 2007</th></tr></table></td></tr></table>\n
> </body>\n
> </html>
> finished.
>
> **** end log
>
>
>
> David Wang wrote:
>
> > If you can trigger this with a single request, can you use a tool like
> > WFetch to make the request and report the entire HTTP response, \r\n
> > included, so that we can determine what exactly is going awry.
>
>
>
> [agri-log.txt]started....
> WWWConnect::Close("agriculture.gov.bb","80")\n
> closed source port: 3261\r\n
> WWWConnect::Connect("agriculture.gov.bb","80")\n
> source port: 3274\r\n
> REQUEST: **************\n
> GET /library/cgi-bin/perldiver.pl HTTP/1.1\r\n
> Host: agriculture.gov.bb\r\n
> Accept: */*\r\n
> \r\n
> RESPONSE: **************\n
> HTTP/1.1 200 OK\r\n
> Date: Fri, 11 May 2007 13:58:54 GMT\r\n
> Server: Microsoft-IIS/6.0\r\n
> \r\n
> Content-Type: text/html; charset=3DISO-8859-1\r\n
> \r\n
> <!DOCTYPE html\n
> \tPUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n
> \t "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n
> <html xmlns=3D"
http://www.w3.org/1999/xhtml" lang=3D"en-US" xml:lang=3D"e=
n-US">\n
> <head>\n
> <title>Perl Diver : Main</title>\n
> <style type=3D"text/css">\n
> <!--/* <![CDATA[ */\n
> body {\n
> background: "#FFFFF";\n
> scrollbar-face-color: "#FFCC66";\n
> scrollbar-shadow-color: "#FF6600";\n
> scrollbar-highlight-color: "#FFCC66";\n
> scrollbar-3dlight-color: "#FFFFFF";\n
> scrollbar-darkshadow-color: "#000000";\n
> scrollbar-track-color: "#E2DAD1";\n
> scrollbar-arrow-color: "#000000";\n
> font-size: "x-small";\n
> font-family: "arial,helvetica,sans-serif"\n
> }\n
> A:hover {\n
> background: "#ffcc66";\n
> color: "#336699";\n
> text-decoration: "overline"\n
> }\n
> A:link {\n
> color: "#BF0425"\n
> }\n
> A:visited {\n
> color: "#336699"\n
> }\n
> th,td,p {\n
> font-size: "x-small"\n
> }\n
> .label {\n
> font-family: "Geneva, Helvetica, sans serif";\n
> font-size: "x-small";\n
> font-weight: bold\n
> }\n
> .HL {\n
> font-size:\t"20pt";\n
>
> letter-spacing:\t".5pt";\n
> font-family: "geneva, arial, sans-serif";\n
> background: "#FDB900";\n
> }\n
> .heading {\n
> font-size: "x-large";\n
> letter-spacing:\t".5pt"\n
> }\n
> .a1 {\n
> background: wheat\n
> }\n
> .a2 {\n
> background: linen\n
> }\n
> .a3 {\n
> background: blanchedalmond\n
> }\n
> .progname {\n
> color: #bf0425;\n
> font-size: xx-large;\n
> }\n
> code,pre {\n
> font-face: "Courier New", mono;\n
> font-size: 11pt;\n
> }\n
> \n
> \n
> \n
> /* ]]> */-->\n
> </style>\n
> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-885=
9-1" />\n
> </head>\n
> <body>\n
> <div class=3D"progname">Perl Diver 2.33</div>
> <table bgcolor=3D"black" border=3D"0" cellspacing=3D"0" cellpadding=3D"1"=
width=3D"100%"><tr><td><table bgcolor=3D"white" cellspacing=3D"0" cellpadd=
ing=3D"1" width=3D"100
> %"><tr><th class=3D"a1">Main</th> <th class=3D"a2"><a href=3D"perldiver.p=
l?action=3D20">Environment Variables</a></th> <th class=3D"a3"><a href=3D"p=
erldiver.pl?act
> ion=3D30">Perl Default Values</a></th> <th class=3D"a1"><a href=3D"perldi=
ver.pl?action=3D40">Perl Config - Summary</a></th> <th class=3D"a2"><a href=
=3D"perldiver.p
> l?action=3D50">Perl Config - Full</a></th> <th class=3D"a3"><a href=3D"pe=
rldiver.pl?action=3D60">Installed Modules</a></th> <th class=3D"a1"><a href=
=3D"perldiver.p
> l?action=3D65">List Directory</a></th> <th class=3D"a2"><a href=3D"perldi=
ver.pl?action=3D66">uptime</a></th> <th class=3D"a3"><a href=3D"perldiver.p=
l?action=3D2000">
> Docs</a></th></tr></table></td></tr></table><p /><table bgcolor=3D"black"=
border=3D"0" cellspacing=3D"0" cellpadding=3D"1" width=3D"100%"><tr><td><t=
able bgcolor=3D
> "white" cellspacing=3D"0" cellpadding=3D"1" width=3D"100%"><tr class=3D"H=
L"><th><span class=3D"heading">Main</span></th></tr><tr><td>Basic paths and=
information<
> /td></tr></table></td></tr></table><p /><table bgcolor=3D"black" border=
=3D"0" cellspacing=3D"0" cellpadding=3D"1" width=3D"100%"><tr><td><table bg=
color=3D"white" c
> ellspacing=3D"0" cellpadding=3D"1" width=3D"100%"><tr class=3D"a1"><td cl=
ass=3D"label" valign=3D"top">Perl Executable</td> <td class=3D"value">C:\Pe=
rl\bin\perlis.dll
> </td></tr>\n
> <tr class=3D"a2"><td class=3D"label" valign=3D"top">Perl version</td> <td=
class=3D"value">5.008008</td></tr>\n
> <tr class=3D"a3"><td class=3D"label" valign=3D"top">Operating System Name=
</td> <td class=3D"value">MSWin32</td></tr>\n
> <tr class=3D"a1"><td class=3D"label" valign=3D"top">GID (If not blank, yo=
u are on a machine that supports membership in multiple groups simultaneous=
ly)</td>
> <td class=3D"value">0</td></tr>\n
> <tr class=3D"a2"><td class=3D"label" valign=3D"top">Path to Perl</td> <td=
class=3D"value"></td></tr>\n
> <tr class=3D"a3"><td class=3D"label" valign=3D"top">Path to sendmail</td>=
<td class=3D"value"></td></tr>\n
> <tr class=3D"a1"><td class
> =3D"label" valign=3D"top">Directories searched for perl modules</td> <td =
class=3D"value">C:/websites/barbados.gov.bb/www/agriculture/library/cgi-bin=
/<=ADbr />C:/
> Perl/site/lib<br />C:/Perl/lib<br />.</td></tr></table></td></tr></table>=
<p /><table bgcolor=3D"black" border=3D"0" cellspacing=3D"0" cellpadding=3D=
"1" width=3D"
> 100%"><tr><td><table bgcolor=3D"white" cellspacing=3D"0" cellpadding=3D"1=
" width=3D"100%"><tr class=3D"HL"><th>Perl Diver brought to you by <a href=
=3D"
http://scrip
> tsolutions.com">ScriptSolutions.com</a> © 1997- 2007</th></tr></tabl=
e></td></tr></table>\n
> </body>\n
> </html>
> finished.- Hide quoted text -
>
> - Show quoted text -