use HTTP::Headers;
use URI::QueryParam;
use Moose::Util::TypeConstraints;
+use Plack::Loader;
use namespace::clean -except => 'meta';
$request->protocol( $env->{SERVER_PROTOCOL} );
$request->remote_user( $env->{REMOTE_USER} );
$request->method( $env->{REQUEST_METHOD} );
- $request->secure( $env->{'psgi.url_scheme'} eq 'https' );
+ $request->secure( $env->{'psgi.url_scheme'} eq 'https' ? 1 : 0 );
return;
}
# set the request URI
my $req_uri = $env->{REQUEST_URI};
$req_uri =~ s/\?.*$//;
- my $path = $self->unescape_uri($req_uri);
+ my $path = $req_uri;
$path =~ s{^/+}{};
# Using URI directly is way too slow, so we construct the URLs manually
$host .= ":$port";
}
- # Escape the path
- $path =~ s/([^$URI::uric])/$URI::Escape::escapes{$1}/go;
- $path =~ s/\?/%3F/g; # STUPID STUPID SPECIAL CASE
-
my $query = $env->{QUERY_STRING} ? '?' . $env->{QUERY_STRING} : '';
my $uri = $scheme . '://' . $host . '/' . $path . $query;
=cut
sub run {
- my ($self, $app) = @_;
+ my ($self, $app, @args) = @_;
+ Carp::cluck("Run");
+ # FIXME - Do something sensible with the options we're passed
+ $self->_run_psgi_app($self->_build_psgi_app($app, @args), @args);
+}
+sub _build_psgi_app {
+ my ($self, $app, @args) = @_;
return sub {
my ($env) = @_;
};
}
+sub _run_psgi_app {
+ my ($self, $psgi_app, @args);
+ # FIXME - Need to be able to specify engine and pass options..
+ Plack::Loader->auto()->run($psgi_app);
+}
+
=head2 $self->write($c, $buffer)
Writes the buffer to the client.