Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 76691
Status: resolved
Priority: 0/
Queue: CGI

People
Owner: MARKSTOS [...] cpan.org
Requestors: SREZIC [...] cpan.org
Cc: srezic [...] iconmobile.com
AdminCc:

Bug Information
Severity: (no value)
Broken in: 3.59
Fixed in: (no value)



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
Subject: Re: [rt.cpan.org #76691] Documentation for -status option
Date: Thu, 19 Apr 2012 09:14:09 -0400
To: bug-cgi [...] rt.cpan.org
From: Mark Stosberg <mark [...] summersault.com>
Thanks for this. I think I had may have been bitten by this myself and didn't realize it. I have had trouble getting "-status => 404" to work, and this may have been why. Mark
Thanks, I'm putting out a new release tonight which include related updates with credit to you.