X-Git-Url: http://git.jankratochvil.net/?p=MyWeb.git;a=blobdiff_plain;f=Redirect.pm;h=871f65faf5d7bf0f79346bc01ede46ec1f256a8b;hp=25cbfb51564cad0d3b7f432fe6ca43af612397b5;hb=refs%2Fheads%2Fmaster;hpb=3642e53fcbb31138ad82ab3ab18bc51234ff178d diff --git a/Redirect.pm b/Redirect.pm index 25cbfb5..871f65f 100644 --- a/Redirect.pm +++ b/Redirect.pm @@ -24,22 +24,20 @@ use strict; use warnings; use My::Web; -use Apache2::Const qw(HTTP_MOVED_TEMPORARILY); +use Apache2::Const qw(HTTP_MOVED_PERMANENTLY); -our $HTML_TEST=0; +our $HTML_TEST="download"; +our $HTML_TEST_RC=HTTP_MOVED_PERMANENTLY; +our $HTML_TEST_QUERY_STRING="location=http://localhost/"; sub handler { my $W=My::Web->init( - "header_only"=>1, "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); } 1;