Skip to content

Commit

Permalink
fix host method error
Browse files Browse the repository at this point in the history
fixes the error:

    Can't locate object method "host" via package "URI::_foreign" at /omd/sites/Prom1/share/thruk/lib/Thruk/Utils/Filter.pm line 1728
  • Loading branch information
sni committed Jul 8, 2024
1 parent 10d8cac commit 2cf8290
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Thruk/Utils/Filter.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1723,6 +1723,11 @@ sub _is_frame_url_allowed {
$url = URI->new($url);
my $req = $c->req->uri;

# unknown links cannot be embedded
return unless $url;
return unless $url->can("scheme");
return unless $url->can("host");

# relative links are allowed
return 1 unless $url->scheme;
return 1 unless $url->host;
Expand Down

0 comments on commit 2cf8290

Please sign in to comment.