+ my ( $self, $r ) = @_;
+ $self->{ar} = Apache::Request->new($r);
+}
+
+sub parse_location {
+ my $self = shift;
+
+ # Reconstruct the request headers
+ $self->headers_in(Maypole::Headers->new);
+ my %headers;
+ if (APACHE2) { %headers = %{$self->{ar}->headers_in};
+ } else { %headers = $self->{ar}->headers_in; }
+ for (keys %headers) {
+ $self->headers_in->set($_, $headers{$_});
+ }
+
+ $self->{path} = $self->{ar}->uri;
+ my $loc = $self->{ar}->location;
+ no warnings 'uninitialized';
+ $self->{path} .= '/' if $self->{path} eq $loc;
+ $self->{path} =~ s/^($loc)?\///;
+ $self->parse_path;
+ $self->parse_args;