diff --git a/lib/haproxy_parser.pm b/lib/haproxy_parser.pm index 9734007..69b4562 100644 --- a/lib/haproxy_parser.pm +++ b/lib/haproxy_parser.pm @@ -22,16 +22,19 @@ sub parser { m/(\ ($re_host):[0-9]{1,6})/gcix && do { $host = $2; }; - } elsif($string =~ m/https\~ https\/\/) { - if($string =~ m/-1\/-1\/-1\/-1\/[0-9]{1,20} 0 0/) { - #This one seems like someone is doing something bad. Return code 0 + } elsif($string =~ m/http(s\~|) http(s|)\/\/) { + if($string =~ m/-1\/-1\/-1\/-1\/[0-9]{1,20} (400|0) 0/) { + #This one seems like someone is doing something bad. Return code 400/0 $_ = $string; $hostile = 1; - $reply = 'Bad request, return code 0'; + $reply = 'Bad request, return code 400/0'; PARSE: m/(\ ($re_host):[0-9]{1,6})/gcix && do { $host = $2; }; + } else { + #Other requests of this type seems to be ... not too bad + $reply = 'Not routed, but probs only random error codes' } } elsif($string =~ m/https\~ /) { #Accepted as https, probably fine..