git://git.jankratochvil.net
/
MyWeb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a481095
)
Unify/simplify redirects handings by: &My::Web::http_moved
author
short
<>
Sun, 18 Sep 2005 20:18:10 +0000
(20:18 +0000)
committer
short
<>
Sun, 18 Sep 2005 20:18:10 +0000
(20:18 +0000)
Redirect.pm
patch
|
blob
|
history
diff --git
a/Redirect.pm
b/Redirect.pm
index
25cbfb5
..
0c0654a
100644
(file)
--- a/
Redirect.pm
+++ b/
Redirect.pm
@@
-24,7
+24,7
@@
use strict;
use warnings;
use My::Web;
use warnings;
use My::Web;
-use Apache2::Const qw(HTTP_MOVED_
TEMPORARI
LY);
+use Apache2::Const qw(HTTP_MOVED_
PERMANENT
LY);
our $HTML_TEST=0;
our $HTML_TEST=0;
@@
-32,14
+32,11
@@
our $HTML_TEST=0;
sub handler
{
my $W=My::Web->init(
sub handler
{
my $W=My::Web->init(
- "header_only"=>1,
"args_check"=>{
"location"=>'^\w+://',
},
);
"args_check"=>{
"location"=>'^\w+://',
},
);
-$W->{"r"}->status(HTTP_MOVED_TEMPORARILY);
-$W->{"r"}->headers_out()->{"Location"}=$W->{"args"}{"location"};
-
-exit 0;
+My::Web->http_moved($W->{"args"}{"location"},HTTP_MOVED_PERMANENTLY);
+die "NOTREACHED";
}
1;
}
1;