use Log::Log4perl;
use constant ACCESSLOG_FORMAT => '%{X-Forwarded-For}i|%h %u "%r" %>s %b "%{Referer}i" "%{User-agent}i"';
+use constant CONTENT_SECURITY_POLICY => q,default-src 'none'; script-src 'self' www.google-analytics.com; style-src 'self'; img-src 'self'; connect-src 'self',;
$Apache2::AuthzCaps::rootdir = $Apache2::Authen::Passphrase::rootdir;
my $word = qr,(\w+),a;
enable_if { $_[0]->{PATH_INFO} eq '/ok' } sub { sub{ [200, [], []] }};
enable 'AccessLog', format => ACCESSLOG_FORMAT, logger => sub { $access_logger->info(@_) };
enable 'ContentLength';
+ enable Header => set => ['Content-Security-Policy', CONTENT_SECURITY_POLICY];
enable_if { $_[0]->{PATH_INFO} =~ qr,^/static/,} Header => set => ['Cache-Control', 'public, max-age=604800'];
enable 'Static', path => qr,^/static/,;
enable 'Log4perl', category => 'plack';