wethepeople.win/wethepeople.pl

23 lines
562 B
Perl
Executable File

#!/usr/bin/env perl
use Mojolicious::Lite;
get '/' => sub {
my ($c) = @_;
my $hostHeader = $c->req->headers->host();
my $scheme = $c->req->url->base->scheme();
if ($hostHeader =~ /www.wethepeople.win(|:[0-9]{1,5})/) {
$c->render()
}
else {
$c->redirect_to("$scheme://www.wethepeople.win")
}
# Opt out of Google FLoC
# https://paramdeo.com/blog/opting-your-website-out-of-googles-floc-network
$c->res->headers->header('Permissions-Policy', 'interest-cohort=()');
} => 'index';
app->start();