Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the name of 302 statuses from Moved to Found #4

Merged
merged 1 commit into from Oct 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/CGI/Simple.pm
Expand Up @@ -1115,7 +1115,7 @@ sub redirect {
my @o;
for ( @other ) { tr/\"//d; push @o, split "=", $_, 2; }
unshift @o,
'-Status' => '302 Moved',
'-Status' => '302 Found',
'-Location' => $url,
'-nph' => $nph;
unshift @o, '-Target' => $target if $target;
Expand Down
6 changes: 3 additions & 3 deletions t/030.function.t
Expand Up @@ -93,7 +93,7 @@ is(

is(
redirect( 'http://somewhere.else' ),
"Status: 302 Moved${CRLF}Location: http://somewhere.else${CRLF}${CRLF}",
"Status: 302 Found${CRLF}Location: http://somewhere.else${CRLF}${CRLF}",
"CGI::redirect() 1"
);

Expand All @@ -104,7 +104,7 @@ my $h = redirect(

is(
$h,
"Status: 302 Moved${CRLF}Location: http://somewhere.else${CRLF}"
"Status: 302 Found${CRLF}Location: http://somewhere.else${CRLF}"
. "Content-Type: text/html; charset=ISO-8859-1${CRLF}${CRLF}",
"CGI::redirect() 2"
);
Expand All @@ -114,7 +114,7 @@ is(
-Location => 'http://somewhere.else/bin/foo&bar',
-Type => 'text/html'
),
"Status: 302 Moved${CRLF}Location: http://somewhere.else/bin/foo&bar${CRLF}"
"Status: 302 Found${CRLF}Location: http://somewhere.else/bin/foo&bar${CRLF}"
. "Content-Type: text/html; charset=ISO-8859-1${CRLF}${CRLF}",
"CGI::redirect() 2"
);
Expand Down
6 changes: 3 additions & 3 deletions t/050.simple.t
Expand Up @@ -914,7 +914,7 @@ ok( $sv =~ /Date:$1GMT/ . 'cache(1), 4' );
# redirect() - scalar and array context, void argument
$sv = $q->redirect( 'http://a.galaxy.far.away.gov' );
$header = <<'HEADER';
Status: 302 Moved
Status: 302 Found
Expires: Tue, 13 Nov 2001 06:45:15 GMT
Date: Tue, 13 Nov 2001 06:45:15 GMT
Pragma: no-cache
Expand All @@ -929,9 +929,9 @@ is( $sv, $header, 'redirect(), 1' );
# redirect() - scalar and array context, void argument
$sv = $q->redirect( -uri => 'http://a.galaxy.far.away.gov', -nph => 1 );
$header = <<'HEADER';
HTTP/1.0 302 Moved
HTTP/1.0 302 Found
Server: Apache - accept no substitutes
Status: 302 Moved
Status: 302 Found
Expires: Tue, 13 Nov 2001 06:49:24 GMT
Date: Tue, 13 Nov 2001 06:49:24 GMT
Pragma: no-cache
Expand Down
6 changes: 3 additions & 3 deletions t/070.standard.t
Expand Up @@ -920,7 +920,7 @@ is(

$sv = redirect( 'http://a.galaxy.far.away.gov' );
$header = <<'HEADER';
Status: 302 Moved
Status: 302 Found
Expires: Tue, 13 Nov 2001 06:45:15 GMT
Date: Tue, 13 Nov 2001 06:45:15 GMT
Pragma: no-cache
Expand All @@ -936,9 +936,9 @@ is( $sv, $header, 'redirect(), 1' );

$sv = redirect( -uri => 'http://a.galaxy.far.away.gov', -nph => 1 );
$header = <<'HEADER';
HTTP/1.0 302 Moved
HTTP/1.0 302 Found
Server: Apache - accept no substitutes
Status: 302 Moved
Status: 302 Found
Expires: Tue, 13 Nov 2001 06:49:24 GMT
Date: Tue, 13 Nov 2001 06:49:24 GMT
Pragma: no-cache
Expand Down