Subject: | Documentation for -status option |
In the CGI Pod documentation there's at least place where the -status
parameter is specified only with a code, but without the
human-readable phrase:
print $q->redirect(
-uri=>'http://somewhere.else/in/movie/land',
-nph=>1,
-status=>301);
Per RFC http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1
the http status must contain a phrase which could be empty, but at
least the space between code and phrase is mandatory.
Using just the status code may cause problems if proxies or browsers are
strictly conforming to the RFC. For example, perlbal 1.79 simply hangs
when doing a reverse proxy operation to an Apache running the
following two scripts:
#!/usr/bin/perl
use CGI 'header';
print header(
-status => '500',
#-status => '500 Server Error',
);
print "An error happened.\n";
__END__
#!/usr/bin/perl
use CGI 'redirect';
print redirect(
-uri => 'http://www.perl.org',
-status => '301',
#-status => '301 Moved',
);
__END__
If I exchange the code-only status values with the ones using code and
phrase, then perlbal is happy with the result.
So my suggestions are:
- fix the mentioned place in the CGI documentation (301 -> "301
Moved")
- maybe make it clear in the documentation that the phrase is
mandatory
Regards,
Slaven