wethepeople.win/wethepeople.pl

23 lines
562 B
Perl
Raw Normal View History

2021-01-21 00:15:31 -05:00
#!/usr/bin/env perl
use Mojolicious::Lite;
get '/' => sub {
2021-01-22 20:03:15 -05:00
my ($c) = @_;
my $hostHeader = $c->req->headers->host();
my $scheme = $c->req->url->base->scheme();
2021-01-21 00:15:31 -05:00
2021-01-22 20:03:15 -05:00
if ($hostHeader =~ /www.wethepeople.win(|:[0-9]{1,5})/) {
$c->render()
}
else {
2021-01-23 19:23:22 -05:00
$c->redirect_to("$scheme://www.wethepeople.win")
2021-01-22 20:03:15 -05:00
}
# 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=()');
2021-01-21 00:15:31 -05:00
} => 'index';
app->start();