|
|
@ -11,6 +11,11 @@ use Mojo::URL; |
|
|
|
sub register { |
|
|
|
sub register { |
|
|
|
my ($self, $app) = @_; |
|
|
|
my ($self, $app) = @_; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$app->helper(allow_cors => sub { |
|
|
|
|
|
|
|
my ($c) = @_; |
|
|
|
|
|
|
|
$c->res->headers->add('Access-Control-Allow-Origin' => '*'); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
}); |
|
|
|
$app->helper(referrer => sub { |
|
|
|
$app->helper(referrer => sub { |
|
|
|
my ($c) = @_; |
|
|
|
my ($c) = @_; |
|
|
|
my $url = $c->req->headers->referrer || |
|
|
|
my $url = $c->req->headers->referrer || |
|
|
|