I have a machine-reading ASP perl script that returns a different status
code for every possible exit point of the program. Its all part of it
being machine readable. When its good, its a 2xx number. When its an
error, its 5xx number. But not 200 or 500. This hasn't been a problem,
until today, when I was troubleshooting a problem and found my codes are
being transformed...
versions:
This is perl, v5.8.0 built for i386-linux-thread-multi
package Apache::ASP;
$VERSION = 2.37;
Server version: Apache/1.3.27 (Unix) Debian GNU/Linux
mod_perl debian package - 2.37-3
I present here two files. One works fine, one doesn't.
--- begin test.cgi ---
#!/usr/bin/perl
print "Status: 213 Woof woof\n";
print "Content-type: text/html\n";
print "CustomHeader: Woof!\n";
print "\n";
print "Woof\n";
--- end test.cgi ---
Don't forget to make that file executable!
--- begin test.asp ---
<%
$Response->{"Status"} = "213 Woof woof";
$Response->{"Content-type"} = "text/html";
$Response->AddHeader("CustomHeader", "Woof!");
$Response->write("Woof\n");
%>
--- end test.asp ---
When I access test.cgi, I get
---
HTTP/1.1 213 Woof woof
Date: Mon, 10 Nov 2003 07:40:51 GMT
Server: Apache/1.3.27 (Unix) Debian GNU/Linux mod_perl/1.27
CustomHeader: Woof!
Transfer-Encoding: chunked
Content-Type: text/html; charset=iso-8859-1
5
Woof
0
---
And when I access test.asp, I get
---
HTTP/1.1 500 Internal Server Error
Date: Mon, 10 Nov 2003 07:46:00 GMT
Server: Apache/1.3.27 (Unix) Debian GNU/Linux mod_perl/1.27
Set-Cookie: session-id=05e5f34d1d135cb082892941834b5f37; path=/
CustomHeader: Woof!
Content-Length: 5
Cache-Control: private
Content-Type: text/html; charset=iso-8859-1
Woof
---
The Status property of the Response object per the ASP implimentation on
windows IIS takes the whole string '213 Woof woof'. And outputs it just
like the Status: header in cgi spec. This is the expected, documented
behavior of the status property on the Response object, to my
understanding.
On the other hand, the Apache::ASP implimentation seems to ignore my
custom message and barf with a 500 error when I try to set it.
Why is Apache::ASP trying to restrict what I can return to the client for
status codes and messages? What am I missing here?
Skylos
- [EMAIL PROTECTED]
- The best part about the internet is nobody knows you're a dog.
(Peter Stiener, The New Yorker, July 5, 1993)
- Dogs like... TRUCKS! (Nissan commercial, 1996)
- PGP key: http://dogpawz.com/skylos/mykey.asc
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]