summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen
diff options
context:
space:
mode:
Diffstat (limited to 'lib/DBInfoscreen')
-rw-r--r--lib/DBInfoscreen/Helper/HAFAS.pm13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/DBInfoscreen/Helper/HAFAS.pm b/lib/DBInfoscreen/Helper/HAFAS.pm
index 249d308..0a98e73 100644
--- a/lib/DBInfoscreen/Helper/HAFAS.pm
+++ b/lib/DBInfoscreen/Helper/HAFAS.pm
@@ -385,12 +385,15 @@ sub get_polyline_p {
my $api = $self->{api};
my $url = "${api}/trips/${trip_id}?lineName=${line}&polyline=true";
+ my $log_url = $url;
my $cache = $self->{realtime_cache};
my $promise = Mojo::Promise->new;
+ $log_url =~ s{://\K[^:]+:[^@]+\@}{***@};
+
if ( my $content = $cache->thaw($url) ) {
$promise->resolve($content);
- $self->{log}->debug("GET $url (cached)");
+ $self->{log}->debug("GET $log_url (cached)");
return $promise;
}
@@ -401,14 +404,14 @@ sub get_polyline_p {
if ( my $err = $tx->error ) {
$self->{log}->warn(
-"hafas->get_polyline_p($url): HTTP $err->{code} $err->{message}"
+"hafas->get_polyline_p($log_url): HTTP $err->{code} $err->{message}"
);
$promise->reject(
- "GET $url returned HTTP $err->{code} $err->{message}");
+ "GET $log_url returned HTTP $err->{code} $err->{message}");
return;
}
- $self->{log}->debug("GET $url (OK)");
+ $self->{log}->debug("GET $log_url (OK)");
my $json = decode_json( $tx->res->body );
my @coordinate_list;
@@ -435,7 +438,7 @@ sub get_polyline_p {
)->catch(
sub {
my ($err) = @_;
- $self->{log}->debug("GET $url (error: $err)");
+ $self->{log}->debug("GET $log_url (error: $err)");
$promise->reject($err);
return;
}