]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Modules/HTTPDtype.pl
take a few more things literally
[infobot.git] / src / Modules / HTTPDtype.pl
index b65cc75138c4b60d1680b7bd8b484551f027e4f8..5906077f64d395c6117e6b3d4c81f0123925d2ae 100644 (file)
@@ -8,10 +8,11 @@ use strict;
 package HTTPDtype;
 
 sub HTTPDtype {
-    my ($HOST) = @_;
+    my($HOST) = @_;
     my($line) = '';
     my($code, $mess, %h);
 
+    # TODO: remove leading http:// and trailing :port and /foo if found
     $HOST = 'joeysmith.com' unless length($HOST) > 0;
     return unless &::loadPerlModule("Net::HTTP::NB");
     return unless &::loadPerlModule("IO::Select");
@@ -20,14 +21,13 @@ sub HTTPDtype {
        $s->write_request(HEAD => "/");
 
        my $sel = IO::Select->new($s);
-       $line = "Header timeout" unless $sel->can_read(10);
+       $line = 'Header timeout' unless $sel->can_read(10);
        ($code, $mess, %h) = $s->read_response_headers;
 
        $line = (length($h{Server}) > 0) ? $h{Server} :
          "Couldn't fetch headers from $HOST";
 
-    &::pSReply($line||"Unknown Error Condition");
-
+    &::performStrictReply($line||'Unknown Error Condition');
 }
 
 1;