view Lib/IMPL/Web/QueryHandler/PathInfoRewrite.pm @ 180:d1676be8afcc

Перекодировка в utf-8
author sourcer
date Fri, 30 Dec 2011 23:40:00 +0300
parents 4267a2ac3d46
children 4d0e1962161c
line wrap: on
line source

package IMPL::Web::QueryHandler::PathInfoRewrite;
use strict;

use parent qw(IMPL::Web::QueryHandler);
__PACKAGE__->PassThroughArgs;

use IMPL::Class::Property;

BEGIN {
	public property pathinfoPrefix => prop_all;
}

sub Process {
	my ($this,$query,$nextHandler) = @_;
	
	my $pathInfo = $ENV{PATH_INFO};
	if (my $rx = $this->pathinfoPrefix) {
		$pathInfo =~ s/^($rx)//;
	}
	
	local $ENV{PATH_INFO} = $pathInfo;
	
	scalar $nextHandler->();
}

1;