diff --git a/www-swagg.pl b/www-swagg.pl index f61677f..bbea8e0 100755 --- a/www-swagg.pl +++ b/www-swagg.pl @@ -14,10 +14,10 @@ plugin 'Config'; plugin CGI => ['/cgi-bin/guest.cgi', './cgi-bin/guest_mm.cgi']; plugin CGI => ['/cgi-bin/whoami.cgi', './cgi-bin/whoami.cgi']; -# Handle the session under sub { my ($c) = @_; my $sessionLife = 604800; + my $hostHeader = $c->req->headers->host(); if ($c->cookie('banner') eq 'seen') { # Set session for a week @@ -33,6 +33,11 @@ under sub { # https://paramdeo.com/blog/opting-your-website-out-of-googles-floc-network $c->res->headers->header('Permissions-Policy', 'interest-cohort=()'); + # Work around for swagg.net downtime 05/28/2022 + unless ($hostHeader =~ /^www\./ || app->mode() eq 'development') { + $c->redirect_to("$scheme://www.swagg.net") + } + 1; };