diff options
Diffstat (limited to 'lib/Travel/Status/DE/HAFAS')
-rw-r--r-- | lib/Travel/Status/DE/HAFAS/StopFinder.pm | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/Travel/Status/DE/HAFAS/StopFinder.pm b/lib/Travel/Status/DE/HAFAS/StopFinder.pm index c81c33a..3327af2 100644 --- a/lib/Travel/Status/DE/HAFAS/StopFinder.pm +++ b/lib/Travel/Status/DE/HAFAS/StopFinder.pm @@ -17,12 +17,13 @@ sub new { my ( $obj, %conf ) = @_; my $lang = $conf{language} // 'd'; + my $ua = $conf{ua}; - my %lwp_options = %{ $conf{lwp_options} // { timeout => 10 } }; - - my $ua = LWP::UserAgent->new(%lwp_options); - - $ua->env_proxy; + if ( not $ua ) { + my %lwp_options = %{ $conf{lwp_options} // { timeout => 10 } }; + $ua = LWP::UserAgent->new(%lwp_options); + $ua->env_proxy; + } my $reply; |