aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@yeah.nah.nz>2018-10-02 17:02:32 +1300
committerDavid Phillips <david@yeah.nah.nz>2018-10-02 17:02:32 +1300
commit765205d27f19ff2b4484336b570937feaedd8643 (patch)
treef9d46385ec36a01a3014e1f9b72601a54adbf1da
parent368c962f722853ee0ba371d37e5ba0396e83b900 (diff)
downloadidalius-765205d27f19ff2b4484336b570937feaedd8643.tar.xz
URL_Title: Don't try and use non-existent header
-rw-r--r--Plugin/URL_Title.pm5
1 files changed, 5 insertions, 0 deletions
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;