From da4d26146e4f70b7b4a23e54d1f37be7d487138c Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 13 Feb 2022 08:22:01 +0100 Subject: urlescape station names before passing them to marudor.de --- lib/DBInfoscreen/Helper/Marudor.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/DBInfoscreen/Helper') diff --git a/lib/DBInfoscreen/Helper/Marudor.pm b/lib/DBInfoscreen/Helper/Marudor.pm index f2a58cf..60ab17a 100644 --- a/lib/DBInfoscreen/Helper/Marudor.pm +++ b/lib/DBInfoscreen/Helper/Marudor.pm @@ -12,6 +12,7 @@ use DateTime; use Encode qw(decode encode); use Mojo::JSON qw(decode_json); use Mojo::Promise; +use Mojo::Util qw(url_escape); use XML::LibXML; sub new { @@ -144,6 +145,9 @@ sub get_train_utilization { return $promise; } + $this_station = url_escape($this_station); + $next_station = url_escape($next_station); + $self->get_json_p( $self->{realtime_cache}, "https://marudor.de/api/hafas/v2/auslastung/${this_station}/${next_station}/${train_no}/${dep}" )->then( -- cgit v1.2.3