From f51b692a69bb6efdba4017e30b16e2a29d783bfc Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Wed, 24 Apr 2024 19:54:24 +0200 Subject: stationboard: handle accept: application/json as well --- lib/DBInfoscreen/Controller/Stationboard.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/DBInfoscreen') diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index 078be87..6893cc0 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -469,7 +469,12 @@ sub handle_request { # (or used by) marudor.de, it was renamed to 'json'. Many clients won't # notice this for year to come, so we make sure mode=marudor still works as # intended. - if ( $template eq 'marudor' ) { + if ( + $template eq 'marudor' + or ( $self->req->headers->accept + and $self->req->headers->accept eq 'application/json' ) + ) + { $template = 'json'; } -- cgit v1.2.3