summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-05-10 11:28:09 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-05-10 11:28:09 +0200
commit0a3003a1463f97d4d9e91fa207b49c51fc009c0b (patch)
tree85382936c9e5b66ec57911447f4c5c42cb37dcd8
parent066179c388f1386d497cbb34b9bfd96bffd0f67e (diff)
add CORS support
-rw-r--r--index.pl2
1 files changed, 2 insertions, 0 deletions
diff --git a/index.pl b/index.pl
index 1e709a2..0289989 100644
--- a/index.pl
+++ b/index.pl
@@ -505,6 +505,7 @@ sub handle_request {
}
if ( $template eq 'json' ) {
+ $self->res->headers->access_control_allow_origin('*');
my $json = $self->render_to_string(
json => {
api_version => $api_version,
@@ -527,6 +528,7 @@ sub handle_request {
}
}
elsif ( $template eq 'marudor' ) {
+ $self->res->headers->access_control_allow_origin('*');
my $json = $self->render_to_string(
json => {
departures => \@departures,