Subject: | URI::Heuristic doesn't work properly when generic country code is specified |
Hi. Though its negative fallback test happens to pass, one of the
guessed hostname by uf_uristr("perl/camel.gif") is
"www.$host.bv." (which should be "www.perl.bv.") when
$URI::Heuristic::MY_COUNTRY is set to "bv". Attached patch should fix
this.
By the way, funky DNS may sometimes return some static ip address even
when a host does not exist (to serve advertisement et al). So, sadly
the test mentioned above may fail, due not to the module, but to the
DNS. I don't think the test should take it into consideration, but
anyway, I'd like to report it for your information.
Subject: | URI-1.36.patch |
diff -ur URI-1.36/URI/Heuristic.pm URI-1.36-patched/URI/Heuristic.pm
--- URI-1.36/URI/Heuristic.pm 2008-04-03 06:24:00.000000000 +0900
+++ URI-1.36-patched/URI/Heuristic.pm 2008-04-18 00:45:13.849250000 +0900
@@ -172,7 +172,7 @@
push(@guess, map { s/\bACME\b/$host/; $_ }
@special);
} else {
- push(@guess, 'www.$host.' . MY_COUNTRY());
+ push(@guess, "www.$host." . MY_COUNTRY());
}
}
push(@guess, map "www.$host.$_",