- my $ctx = {cgi => $cgi, pi_config => $self->{pi_config}, www => $self};
- my $path_info = $cgi->path_info;
+ my $ctx = { cgi => $cgi, env => $env, www => $self,
+ pi_config => $self->{pi_config} };
+
+ # we don't care about multi-value
+ my %qp = map {
+ my ($k, $v) = split('=', $_, 2);
+ $v = '' unless defined $v;
+ $v =~ tr/+/ /;
+ ($k, $v)
+ } split(/[&;]/, uri_unescape($env->{QUERY_STRING}));
+ $ctx->{qp} = \%qp;
+
+ my $path_info = $env->{PATH_INFO};
+ my $method = $env->{REQUEST_METHOD};