X-Git-Url: https://git.jankratochvil.net/?a=blobdiff_plain;f=Web.pm;h=6b76695d16763b4e9e7cbe50dfbd052c4ad4283e;hb=ee36f55cab44a05ddb218efafc9e553070baba8e;hp=93a4bb5d2876ff9642deb7ef1f4d43571e7f958e;hpb=6fc5108ff140faddfad71cadbd48ce87557fbbcb;p=MyWeb.git diff --git a/Web.pm b/Web.pm index 93a4bb5..6b76695 100644 --- a/Web.pm +++ b/Web.pm @@ -670,12 +670,14 @@ sub a_href_cc($$;%) { my($url,$contents,%args)=@_; + # A bit ineffective but we must process all the possibilities to get stable 'headers_in' hits! + my %map=map(($_=>a_href($url->{$_},$contents,%args)),keys(%$url)); my $cc; $cc||=Geo::IP->new()->country_code_by_addr(remote_ip()) if $have_Geo_IP; $cc||=""; - $url=$url->{$cc}; - return $contents if !$url; - return a_href $url,$contents,%args; + my $r=$map{$cc}; + return $r if $r; + return $contents; } sub make ($)