From 765205d27f19ff2b4484336b570937feaedd8643 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Tue, 2 Oct 2018 17:02:32 +1300 Subject: URL_Title: Don't try and use non-existent header --- Plugin/URL_Title.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Plugin/URL_Title.pm b/Plugin/URL_Title.pm index e93de26..205a6c5 100644 --- a/Plugin/URL_Title.pm +++ b/Plugin/URL_Title.pm @@ -55,6 +55,11 @@ sub on_message return; } + if (not $response->{headers}->{"content-type"}) { + $logger->("No content-type in reponse header, not continuing"); + return; + } + if (!($response->{headers}->{"content-type"} =~ m,(text/html|image/svg\+xml),)) { $logger->("I don't think I can parse titles from $response->{headers}->{'content-type'} - stopping here"); return; -- cgit v1.1