From 5303d254dab88d7b75e2cd834ac485d0a0a334b7 Mon Sep 17 00:00:00 2001 From: swaggboi Date: Sat, 28 May 2022 09:41:35 -0400 Subject: [PATCH] Implement www redirect due to swagg.net downtime --- www-swagg.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; };