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: 17066
Status: resolved
Priority: 0/
Queue: CGI

People
Owner: Nobody in particular
Requestors: david [...] dorward.me.uk
Cc:
AdminCc:

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

Attachments


Subject: redirect method returns malformed HTTP ("Moved" should be "Found")
Download (untitled) / with headers
text/plain 769b
Section 6.1 of the HTTP 1.1 specification states: The first line of a Response message is the Status-Line, consisting of the protocol version followed by a numeric status code and its associated textual phrase. When calling the redirect method of CGI.pm (including the latest version, 3.15, from CPAN) on perl 5.8.7 on Linux 2.6.14-gentoo-r5 with: perl -MCGI -e'print CGI->redirect("http://example.com")' The output is: Status: 302 Moved Location: http://example.com "Moved" is the textual phrase associated with the 301 status code. The text for 302 should be "Found". This error can be corrected by modifying line 1502 of version 3.15. I've attached a patch generated with: diff -U 8 -p CGI.pm CGI-dd.pm > CGI.pm-redirect.patch
Subject: CGI.pm-redirect.patch
--- CGI.pm 2006-01-14 12:26:20.000000000 +0000 +++ CGI-dd.pm 2006-01-14 12:26:47.000000000 +0000 @@ -1494,17 +1494,17 @@ END_OF_FUNC # Return a Location: style header # #### 'redirect' => <<'END_OF_FUNC', sub redirect { my($self,@p) = self_or_default(@_); my($url,$target,$status,$cookie,$nph,@other) = rearrange([[LOCATION,URI,URL],TARGET,STATUS,['COOKIE','COOKIES'],NPH],@p); - $status = '302 Moved' unless defined $status; + $status = '302 Found' unless defined $status; $url ||= $self->self_url; my(@o); foreach (@other) { tr/\"//d; push(@o,split("=",$_,2)); } unshift(@o, '-Status' => $status, '-Location'=> $url, '-nph' => $nph); unshift(@o,'-Target'=>$target) if $target;
From: mark [...] summersault.com
This was fixed 3.16, so this bug should be marked as "resolved".
Download (untitled) / with headers
text/plain 148b
The author of CGI.pm prefers bug reports via email. The bug tracking system here has a poorly designed user interface and I don't care to use it.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.