diff --git a/app.psgi b/app.psgi index d03d8570c..bace19496 100644 --- a/app.psgi +++ b/app.psgi @@ -1,8 +1,12 @@ use strict; use Plack::Builder; -use WebGUI::Paths -preload; +use WebGUI::Paths -inc; use WebGUI::Config; +if ($ENV{PLACK_ENV} ne 'development') { + WebGUI::Paths->preloadAll; +} + builder { my $first_app; for my $config_file (WebGUI::Paths->siteConfigs) { diff --git a/var/site.psgi b/var/site.psgi index df738477c..32dd72e6f 100644 --- a/var/site.psgi +++ b/var/site.psgi @@ -8,6 +8,11 @@ builder { my $config = $wg->config; enable 'Log4perl', category => $config->getFilename, conf => WebGUI::Paths->logConfig; + enable 'SimpleContentFilter', filter => sub { + if ( utf8::is_utf8($_) ) { + utf8::encode($_); + } + }; # Reproduce URL handler functionality with middleware enable '+WebGUI::Middleware::Snoop';