Bug 26724 - 'Action' directives involving 'non-parsed-headers' CGI modules do not work correctly.
Summary: 'Action' directives involving 'non-parsed-headers' CGI modules do not work co...
Status: RESOLVED DUPLICATE of bug 22898
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_actions (show other bugs)
Version: 2.0.48
Hardware: PC Windows XP
: P3 normal with 2 votes (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-06 13:01 UTC by Chris Munt
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Munt 2004-02-06 13:01:16 UTC
The following configuration construct (in httpd.conf) does not work with 'non 
parsed headers' CGI modules.

Example:

Action my-handler /cgi-bin/nph-cm.pl
AddHandler my-handler csp cls

This should invoke the script 'nph-cm.pl' for requests for files with 
extension 'csp' or 'cls'.  Apache should allow the CGI script to return its 
own header without interfering:

Script nph-cm.pl:

#!C:/perl/bin/perl.exe

print "$ENV{SERVER_PROTOCOL} 200 OK\n";
print "Server: $ENV{SERVER_SOFTWARE}\n";
print "Content-type: text/html\n";
print "Connection: close\n\n";

print "<html><head><title>Test</title></head>\n";
print "<h2>Process: ";
print $ENV{"PATH_TRANSLATED"};
print "</h2>\n";
print "</html>\n";


What actually gets returned (for /csp/samples/loop.csp) is:

HTTP/1.1 200 OK
Server: Apache/2.0.48 (Win32)
Content-type: text/html
Connection: close
 
<html><head><title>Test</title></head>
<h2>Process: C:\cachesys\csp\samples\loop.csp</h2>
</html>
HTTP/1.1 200 OK
Date: Fri, 06 Feb 2004 12:28:04 GMT
Server: Apache/2.0.48 (Win32)
Content-Length: 0
Content-Type: text/csp


Note that Apache tried insert an header at the end of the transmission for 
some reason.  It also hangs for quite a while (around 5 seconds) whilst 
returning this content to the client.  Incidentally, calling the CGI module 
directly through a browser (/cgi-bin/nph-cm.pl) works OK.


Removing the 'nph-' requirement works as expected:

In httpd.conf:

Action my-handler /cgi-bin/cm.pl
AddHandler my-handler csp cls

The script cm.pl:

#!C:/perl/bin/perl.exe

print "Content-type: text/html\n";
print "Connection: close\n\n";

print "<html><head><title>Test</title></head>\n";
print "<h2>Process: ";
print $ENV{"PATH_TRANSLATED"};
print "</h2>\n";
print "</html>\n";
Comment 1 Joe Orton 2004-06-03 16:19:29 UTC

*** This bug has been marked as a duplicate of 22898 ***