Skip to content

Commit

Permalink
fix print response debug information (fixes #1346)
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Mar 22, 2024
1 parent d498fcb commit 5e3a99f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/Thruk/Utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3487,7 +3487,8 @@ sub dump_params {
$max_length = 250 unless defined $max_length;
$flat = 1 unless defined $flat;
$params = Thruk::Utils::IO::dclone($params) if ref $params;
local $Data::Dumper::Indent = 0 if $flat;
local $Data::Dumper::Indent = 1;
local $Data::Dumper::Indent = 0 if $flat;
my $dump = ref $params ? Dumper($params) : $params;
$dump =~ s%^\$VAR1\s*=\s*%%gmx;
$dump = Thruk::Base::clean_credentials_from_string($dump);
Expand Down
7 changes: 6 additions & 1 deletion lib/Thruk/Utils/Filter.pm
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,12 @@ sub html_escape_recursive {
}
elsif(ref $data eq "HASH") {
for my $key (keys %{$data}) {
$data->{$key} = html_escape_recursive($data->{$key});
if(ref $data->{$key} eq 'HTTP::Response') {
$data->{"req"} = html_escape_recursive($data->{$key}->request->as_string) unless $data->{"req"};
$data->{$key} = html_escape_recursive($data->{$key}->as_string);
} else {
$data->{$key} = html_escape_recursive($data->{$key});
}
}
}
else {
Expand Down

0 comments on commit 5e3a99f

Please sign in to comment.