« Previous Next »

Thread: IIS6: IIS output duplicated response headers for perl CGI

Last post 11-22-2009 11:17 AM by mmpower. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 11-07-2009, 4:44 PM

    • mmpower
    • Not Ranked
    • Joined on 11-07-2009, 4:16 PM
    • Posts 2

    IIS6: IIS output duplicated response headers for perl CGI

    Our perl CGI scripts output response headers repeately which were inserted into the output html contents. a sample code:

    use strict;

    use CGI;

    $|=1;

    my $q = new CGI();

    print $q->header("text/html"), $q->start_html("test");

    print "aa";

    print $q->end_html ;

     

     outputs the following on browser:

     HTTP/1.1 200 OK Connection: close Date: Sat, 07 Nov 2009 21:34:27 GMT  Content-Type: text/html; charset=ISO-8859-1 Server: Microsoft-IIS/6.0 aaHTTP/1.1  200 OK Connection: close Date: Sat, 07 Nov 2009 21:34:27 GMT Content-Type:  text/html; charset=ISO-8859-1 Server: Microsoft-IIS/6.0

     

     if I remove the line "$|=1", then it outputs:

    aa

     

    If I run the script above from command line, it also outputs:

    aa

     

    seems everytime the script output something, IIS always automatically append the same response header to the output. So if I change the above script to:

     

    use strict;

    use CGI;

    $|=1;

    my $q = new CGI();

    print $q->header("text/html"), $q->start_html("test");

    print "<br>aa";

    print "<br>bb<br/>";

    print $q->end_html ;

     it now outputs the following on browser:

     HTTP/1.1 200 OK Connection: close Date: Sat, 07 Nov 2009 21:41:32 GMT  Content-Type: text/html; charset=ISO-8859-1 Server: Microsoft-IIS/6.0  
    aa
    bb
    HTTP/1.1 200 OK Connection: close Date: Sat, 07 Nov 2009  21:41:32 GMT Content-Type: text/html; charset=ISO-8859-1 Server:  Microsoft-IIS/6.0

     

    did anybody experience the same issue? how do I fix this?

     

    the server is windows 2003 std with service pack 1, running IIS 6.0. same script runs ok on other server that has the same version of software running.

     

    Thanks,

    --mmpower

     

     

     

  • 11-22-2009, 11:17 AM In reply to

    • mmpower
    • Not Ranked
    • Joined on 11-07-2009, 4:16 PM
    • Posts 2

    Re: IIS6: IIS output duplicated response headers for perl CGI

     Hmmm.. seems nobody knows the answer?

Page 1 of 1 (2 items)
Microsoft Communities