### Blockers
* Test all the options work on all of the scripts
- * Fix nginx / lighttpd middlewares so that they are generic, or can somehow
+ * Fix nginx middlewares so that they are generic, or can somehow
be used by people with their own .psgi files
* Fix a sane / nicer way to do custom engines.
### Nice to have
- * <@rafl> i've been thinking of maybe providing MyApp->apply_default_middlewares($psgi_app)
+ * <@rafl> i've been thinking of maybe providing
+ MyApp->apply_default_middlewares($psgi_app)
* Capture arguments that the plack engine component was run with somewhere,
to more easily support custom args from scripts (e.g. Gitalist's
--git_dir)
EOW
}
- return $app->_wrapped_legacy_psgi_app($app->psgi_app);
+ return $app->apply_default_middlewares($app->psgi_app);
}
-# Note - this is for back compatibility. Catalyst should not know or care about
-# how it's deployed. The recommended way of configuring this is now to
-# use the ReverseProxy middleware yourself if you want it in a .psgi
-# file.
-sub _wrapped_legacy_psgi_app {
+# FIXME - document me
+
+sub apply_default_middlewares {
my ($app, $psgi_app) = @_;
$psgi_app = Plack::Middleware::Conditional->wrap(
my $old_engine = Catalyst::Utils::env_value($self->application_name, 'ENGINE');
if (!defined $old_engine) { # Not overridden
}
- elsif ($old_engine =~ /^(PSGI|CGI|HTTP|Apache.*)$/) {
+ elsif ($old_engine =~ /^(PSGI|CGI|Apache.*)$/) {
# Trust autodetect
}
+ elsif ($old_engine eq 'HTTP') {
+ $engine = 'Standalone';
+ }
elsif ($old_engine eq 'FastCGI') {
$engine = 'FCGI';
}
use namespace::autoclean;
sub run {
- my ($self, $class, $scriptclass) = @_;
+ my ($self, $class, $scriptclass, %args) = @_;
my $classtoload = "${class}::Script::$scriptclass";
lib->import(File::Spec->catdir($FindBin::Bin, '..', 'lib'));
$classtoload = "Catalyst::Script::$scriptclass";
Class::MOP::load_class($classtoload);
}
- $classtoload->new_with_options( application_name => $class )->run;
+ $classtoload->new_with_options( application_name => $class, %args )->run;
}
__PACKAGE__->meta->make_immutable;
=head2 Running with plackup?
+=head2 Tests in 5.89
+
+Tests should generally work the same in Catalyst 5.89, however there are some differences.
+
+Previously, if using L<Catalyst::Test> and doing local requests (against a local server),
+if the application threw an exception then this exception propagated into the test.
+
+This behaviour has been removed, and now a 500 response will be returned to the test.
+This change unifies behaviour, to make local test requests behave similarly to remote
+requests.
+
=head1 Upgrading to Catalyst 5.80
Most applications and plugins should run unaltered on Catalyst 5.80.