Oops - seems I didn't include the group on my reply ....

FYI


Here is another test I did (simpler)

-------------------- Apache Config --------------------

PerlModule FNBC::test_statusline
PerlWarn On

<Location /test1>
   SetHandler perl-script
   PerlResponseHandler FNBC::test_statusline
</Location>

-------------------- test_statusline.pm --------------------

package FNBC::test_statusline;
use strict;
use warnings;
use Apache2::Access ();
use Apache2::RequestUtil ();
use Apache2::RequestRec ();
use Apache2::Const -compile => qw( OK );

sub handler {
   my $r = shift;
   $r->status_line("499 We have been FooBared");
   $r->err_headers_out->add( 'X-Testing' => 'True' );
   $r->content_type( "text/html" );
   my $body = "<html><head><title>Testing</title></head><body><h3>It really
does work...</h3></body></html>";
   $r->set_content_length( length( $body ) );
   $r->print( $body );
   return Apache2::Const::OK;
}
1;

-------------------- Trace --------------------

GET /test1/sdjakgd HTTP/1.1
Host: webdavtest:81
User-Agent: Links (2.2; Linux 2.6.32-24-generic x86_64; 210x65)
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Charset: us-ascii, ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4,
ISO-8859-5, ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-10,
ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16, windows-1250,
windows-1251, windows-1252, windows-1256, windows-1257, cp437, cp737, cp850,
cp852, cp866, x-cp866-u, x-mac, x-mac-ce, x-kam-cs, koi8-r, koi8-u, koi8-ru,
TCVN-5712, VISCII, utf-8
Accept-Language: en, *;q=0.1
Connection: Keep-Alive

HTTP/1.1 200 OK
Date: Tue, 28 Sep 2010 06:06:13 GMT
Server: Apache/2.2.3 (CentOS)
X-Testing: True
Content-Length: 92
Connection: close
Content-Type: text/html; charset=UTF-8

<html><head><title>Testing</title></head><body><h3>It really does
work...</h3></body></html>


I really would like to know why I can not set the status line.... I followed
the example from
http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_status_line_

Thanks

Nico

Reply via email to