【发布时间】:2015-05-04 11:58:57
【问题描述】:
我正在为 Apache2 编写 perl 处理程序。
这是我的配置:
PerlModule xxx::andsf
<Location / >
SetHandler perl-script
PerlHandler xxx::andsf
PerlSendHeader On
</Location>
我的处理程序需要返回客户端 511 HTTP 状态代码。 您可以在此处阅读大约 511:
- http://www.askapache.com/net/http-status-odes.html#Network_Authentication_Required
- http://greenbytes.de/tech/webdav/rfc6585.html#status-511
如果我的代码 返回505; 我收到正确的状态 505 HTTP 版本不支持。 但如果我把 返回 511; 我得到 500 - 内部服务器错误。 似乎 Apache 忽略了奇怪的错误代码。
任何想法如何返回 511?
更新处理程序的代码:
package xxx::andsf;
use Apache2::Const
qw( :common );
use Apache2::RequestRec ();
use Apache2::RequestIO ();
sub handler {
my $r = shift;
$r->status_line("511 Network Authentication Requred");
return Apache2::Const::OK;
}
1;
【问题讨论】: