From 7151176d5d2a05ed6c8c30ea8944e518099c1173 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 6 Sep 2020 11:20:32 +0200 Subject: include instance URL in UA --- lib/DBInfoscreen.pm | 2 ++ lib/DBInfoscreen/Helper/HAFAS.pm | 3 ++- lib/DBInfoscreen/Helper/Wagonorder.pm | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/DBInfoscreen.pm b/lib/DBInfoscreen.pm index b31a1a7..72be819 100644 --- a/lib/DBInfoscreen.pm +++ b/lib/DBInfoscreen.pm @@ -105,6 +105,7 @@ sub startup { log => $self->app->log, main_cache => $self->app->cache_iris_main, realtime_cache => $self->app->cache_iris_rt, + root_url => $self->url_for('/')->to_abs, user_agent => $self->ua, version => $VERSION, ); @@ -117,6 +118,7 @@ sub startup { state $hafas = DBInfoscreen::Helper::Wagonorder->new( log => $self->app->log, cache => $self->app->cache_iris_main, + root_url => $self->url_for('/')->to_abs, user_agent => $self->ua, version => $VERSION, ); diff --git a/lib/DBInfoscreen/Helper/HAFAS.pm b/lib/DBInfoscreen/Helper/HAFAS.pm index c9a2ba2..ba6295f 100644 --- a/lib/DBInfoscreen/Helper/HAFAS.pm +++ b/lib/DBInfoscreen/Helper/HAFAS.pm @@ -16,7 +16,8 @@ sub new { $opt{header} = { 'User-Agent' => - "dbf/${version} +https://finalrewind.org/projects/db-fakedisplay" }; +"dbf/${version} on $opt{root_url} +https://finalrewind.org/projects/db-fakedisplay" + }; return bless( \%opt, $class ); diff --git a/lib/DBInfoscreen/Helper/Wagonorder.pm b/lib/DBInfoscreen/Helper/Wagonorder.pm index 98c22ca..91006fc 100644 --- a/lib/DBInfoscreen/Helper/Wagonorder.pm +++ b/lib/DBInfoscreen/Helper/Wagonorder.pm @@ -16,7 +16,8 @@ sub new { $opt{header} = { 'User-Agent' => - "dbf/${version} +https://finalrewind.org/projects/db-fakedisplay" }; +"dbf/${version} on $opt{root_url} +https://finalrewind.org/projects/db-fakedisplay" + }; return bless( \%opt, $class ); -- cgit v1.2.3